Date: Fri, 25 Oct 2002 11:56:51 -0700
Reply-To: Chris Wu <chris.wu@CIBC.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Chris Wu <chris.wu@CIBC.COM>
Organization: http://groups.google.com/
Subject: Re: MVS:ODS multiple outputs from sorted sasdata on TAPE.
Content-Type: text/plain; charset=ISO-8859-1
Thanks Peter,
The filevar= option helped out.
The following is a program developed with other sources.
It was able to produce two files, but the latter ran out of space (at
16cyl), even though allocation is CYL,(100,10) ... why?? :
ZYBTOTS.CW191.XLSH.E00001
ZYBTOTS.CW191.XLSH.E00002
-- Chris
SAS Code:
DATA _NULL_;
SET TPESORT.OUT ;
BY FILNAME;
FORMAT _NUMERIC_ BEST32. ;
LENGTH SPACE $20
OUTFILE $64
;
IF _N_ = 1 THEN _FILNAME = '';
ELSE _FILNAME = LAG1(FILNAME);
IF FILNAME ~= _FILNAME THEN DO;
*DDNAME=FNAME;
OUTFILE='ZYTOTS.CW191.XLSH';
*PUT OUTFILE=;
SPACE='(CYL,(100,10)) ';
DCB= 'LRECL=1000 RECFM=VB DSORG=PS DISP=NEW SPACE='
|| SPACE ;
RC=FILENAME(FNAME,OUTFILE,'',DCB);
RC=FILENAME(FNAME,'');
/* CHECK RETURN CODE */
IF RC THEN DO;
MSG=SYSMSG();
PUT RC= MSG= ;
CALL SYMPUT('CANCEL','CANCEL');
ABORT;
END;
FILE DUMMY FILEVAR=FILNAME MOD;
END;
PUT _ALL_ ;
RUN;
/* END OF PROGRAM */
Sample Contents of TPESORT.OUT:
filename fname acct
'ZYBTOTS.CW191.XLSH.E00001' E00001 5194329
'ZYBTOTS.CW191.XLSH.E00001' E00001 5815287
'ZYBTOTS.CW191.XLSH.E00001' E00001 5815303
'ZYBTOTS.CW191.XLSH.E00001' E00001 5996129
'ZYBTOTS.CW191.XLSH.E00002' E00002 5996152
'ZYBTOTS.CW191.XLSH.E00002' E00002 6024889
'ZYBTOTS.CW191.XLSH.E00002' E00002 6169601
'ZYBTOTS.CW191.XLSH.E00003' E00003 6192090
'ZYBTOTS.CW191.XLSH.E00003' E00003 6400386
'ZYBTOTS.CW191.XLSH.E00003' E00003 6464986