Date: Thu, 15 Feb 2001 13:46:47 -0500
Reply-To: "Kerrison, Foster" <FKerrison@NT.DMA.STATE.MA.US>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Kerrison, Foster" <FKerrison@NT.DMA.STATE.MA.US>
Subject: Re: JCL QUESTION FOR SAS JOB
Content-Type: text/plain; charset="iso-8859-1"
Peter,
I was at a more basic level because I thought that you had a faster load
procedure than Paula. I thought that you were talking about not needing to
use JCL DD statements ("You should be able to use dynamic allocations and
have NO jcl dd statements.") for the 52 files that Paula is importing so I
was intrigued as to how you would do that. What you have sent out is neat
and makes very effective use of filevar but we still need to add all the
DSNs in our JCL. :)
For those who might be interested I inherited a macro to create a DSN on
disc. I have never tried to use it for tape. For those who might find it
useful here it is:
%MACRO LIB(LIBNAME,LIBRARY,SPACE=(CYL,(90,90),RLSE),UNIT=SYSDA, ENGINE=);
FILENAME &LIBNAME "&LIBRARY" DISP=(MOD,DELETE);
FILENAME &LIBNAME CLEAR;
LIBNAME &LIBNAME &ENGINE "&LIBRARY"
DISP=(NEW,CATLG,CATLG)
%IF %NRBQUOTE(&SPACE) NE %THEN %DO;
SPACE=&SPACE
%END;
UNIT=&UNIT;
%MEND LIB;
%LIB(OUT,DDDDDD.AAAA.DATA.ON0214.FILE) ;
We put most of our output to SAS datasets so in the example above the "out"
refers to the library, and the DSN is (DDDDDD.AAAA.DATA.ON0214.FILE)
You would use the following datatep ;
data out.dec98 ;
<other data process here>
So now you have a SAS dataset called dec98 in the file/library
DDDDDD.AAAA.DATA.ON0214.FILE. You can add other datasets as space and other
considerations allow.
Hope this clarifies what I was talking about.
Thanks,
Foster Kerrison
> -----Original Message-----
> From: Peter Crawford [SMTP:peter.crawford@DB.COM]
> Sent: Thursday, February 15, 2001 12:54 PM
> To: SAS-L@LISTSERV.UGA.EDU
> Subject: Re: JCL QUESTION FOR SAS JOB
>
> Foster Kerrison is asking for an example of dynamic allocation and
> direction of output,
> both to external files like ABCDE.DATA.DEC98.FILE and to sas data sets
>
>
> something like this to generate tab delimited text files of all
> columns for December events from 1997 to 2001
> selected from the events warehouse (sas dataset warehous.events)
> data _null_;
> retain extDsn ''ABCDE.DATA.xxxxx.FILE' ;
> set warehous.lots(where =( <whatever>
> & month(event) = 12
> & year(event) between 1997 and 2001) );;
> substr( extDsn, 12, 5 ) = put( event, monyy5. );
> file dum filevar = extDsn ; /* assumes existing files */
> put (&varlist)( +(-1) '05'x ) @1 ' ' ; *mainframe tab delimited ;
> run;
> If your external data files are to be _created_ by the file statement,
> there are additional parameters like RECFM=VB and LRECL=3000
> (but DSORG=PS is assumed for external files written by SAS, and the op.sys
> will probably supply a suitable default BLKSIZE
> Additionally some information will need to be supplied indicating the
> total space your external files might need.
> One assumption I made is that you choose to write to disk files
> )
>
> Selecting the output sas dataset according to dynamic data values,
> is completely different, because it needs all target data sets to be
> named on the data statement at the beginning of the data step
> like this example:
> split warehouse december events into 5 separate libraries
> (we use metadata to make a set of libname allocations like this )
> %metalloc( Dec_events, use=old );
> but for those without the convenience of %metalloc()
> libname dec97 'ABCDE.DATA.DEC97.LIB' disp=old;
> libname dec98 'ABCDE.DATA.DEC98.LIB' disp=old;
> libname dec99 'ABCDE.DATA.DEC99.LIB' disp=old;
> libname dec00 'ABCDE.DATA.DEC00.LIB' disp=old;
> libname dec01 'ABCDE.DATA.DEC01.LIB' disp=old;
> *****************untested code follows ;
> data dec97.events
> dec98.events
> dec99.events
> dec00.events
> dec01.events ;
> set warehous.events;
> select ( put( event, monyy5. );
> when( 'DEC97' ) output dec97.events ;
> when( 'DEC98' ) output dec98.events ;
> when( 'DEC99' ) output dec99.events ;
> when( 'DEC00' ) output dec00.events ;
> when( 'DEC01' ) output dec01.events ;
> otherwise;
> run;
>
>
> So Hi Foster,
> were these something like the examples you were seeking ?
>
>
>
>
>
>
>
> Datum: 15.02.2001 18:24
> An: Peter Crawford/Zentrale/DeuBaExt@Zentrale
> SAS-L@listserv.uga.edu
>
>
>
> Betreff: RE: JCL QUESTION FOR SAS JOB
> Nachrichtentext:
>
>
> Peter,
>
> I took it that she had JCL code and was trying to understand what the
> parameters meant. I think thats a good way to learn.
>
> I am intrigued by your code example. Could you write it up into an real
> example?
>
> Lets say that I have 5 files. JCL would look like
>
> //dec98 DD DSN=ABCDE.DATA.DEC98.FILE,DISP=SHR
> //dec99 DD DSN=ABCDE.DATA.DEC99.FILE,DISP=SHR
> //dec00 DD DSN=ABCDE.DATA.DEC00.FILE,DISP=SHR
> //dec01 DD DSN=ABCDE.DATA.DEC01.FILE,DISP=SHR
> //dec97 DD DSN=ABCDE.DATA.DEC97.FILE,DISP=SHR
>
> So how would this look in your example? Can you also show how this would
> be
> done if the files contained SAS datasets as distinct from other formats.
>
> Thanks,
>
> Foster Kerrison
>
> > -----Original Message-----
> > From: Peter Crawford [SMTP:peter.crawford@DB.COM]
> > Sent: Thursday, February 15, 2001 11:56 AM
> > To: SAS-L@LISTSERV.UGA.EDU
> > Subject: Re: JCL QUESTION FOR SAS JOB
> >
> > Hi Paula
> > You've had the explanation of DSORG=PS, but....
> > why haven't they listened to the rest of your mail ??
> > > I'm writing a JCL program to combine 52 files into one so I don't have
> > to
> > > read 52 DD statements when I run a SAS program.
> > You should be able to use dynamic allocations and have NO jcl dd
> > statements.
> > You don't need more than a file statement in the data step which writes
> > all these 52 files
> > Use the filename statement option
> > FILEVAR=varName
> > at the point where you need to start writing to a new file.
> > The variable varName would hold something like
> > CB92025.RSK.DEVL.TUFILL.XXXXXXXX
> > where XXXXXXXX contains a suffix you
> > generate in your program to distinguish the 52.
> > It is possible to generate the generation data set group suffix if you
> > prefer,
> > but (52=weeks in year ?) perhaps your data might be referenced by
> > something more convenient, like week beginning data Dyymmdd
> >
> > Interesting scenario ....
> > Regards
> > Peter Crawford
> >
> >
> > Datum: 15.02.2001 17:15
> > An: SAS-L@listserv.uga.edu
> >
> >
> >
> >
> > Antwort an: FKerrison@nt.dma.state.ma.us
> >
> > Betreff: Re: JCL QUESTION FOR SAS JOB
> > Nachrichtentext:
> >
> >
> > Paula,
> >
> > The DSORG specifies the organization of the dataset:
> >
> > PS = Sequential
> > PO = partitioned
> > DA = direct
> > IS = indexed sequential
> >
> > (ref Doug Lowe, MVS JCL published by Mike Murach & Associates. p150)
> >
> > > -----Original Message-----
> > > From: Paula M. Adkins [SMTP:PAdkins@CHECKFREE.COM]
> > > Sent: Thursday, February 15, 2001 10:46 AM
> > > To: SAS-L@LISTSERV.UGA.EDU
> > > Subject: JCL QUESTION FOR SAS JOB
> > >
> > > MVS SAS Beginner:
> > >
> > > Any JCL experts on line?
> > >
> > > I'm writing a JCL program to combine 52 files into one so I don't have
> > to
> > > read 52 DD statements when I run a SAS program.
> > >
> > > //SORTOUT DD DSN=CB92025.RSK.DEVL.TUFILL(+1),
> > > // DISP=(NEW,CATLG,DELETE),
> > > // SPACE=(CYL,(550,100),RLSE),
> > > // DCB=(RECFM=FB,LRECL=400,DSORG=PS)
> > > //SYSOUT DD SYSOUT=*
> > > //SYSIN DD *
> > >
> > >
> > > The bolded item is what I'm inquiring about. I understand this as Data
> > > Control Block=Record Format=Fixed Block, Record Length=400, DataSet
> > > Organization=Physical Sequence but I don't understand what "Physical
> > > Sequence" means. I found it in Gary DeWard Brown's JCL book but I it
> > > didn't
> > > explain Physical Sequence. Can someone explain this to a
> non-programmer?
> > >
> > > California here I come!
> > > Countdown to SUGI26!
> > >
> > > Paula M. Adkins, Risk Analyst I
> > > Payment Systems Department
> > > CheckFree Corporation
> > > 6000 Perimeter Drive
> > > Dublin, OH 43017
> > > 614-564-3117, 614-564-4308-fax
> > > www.checkfree.com
> >
> >
> >
> >
> >
> > --
> >
> > Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte
> > Informationen. Wenn Sie nicht der richtige Adressat sind oder diese
> E-Mail
> > irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und
> > vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte
> > Weitergabe dieser Mail ist nicht gestattet.
> >
> > This e-mail may contain confidential and/or privileged information. If
> you
> > are not the intended recipient (or have received this e-mail in error)
> > please notify the sender immediately and destroy this e-mail. Any
> > unauthorised copying, disclosure or distribution of the material in this
> > e-mail is strictly forbidden.
>
>
>
>
>
> --
>
> Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte
> Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail
> irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und
> vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte
> Weitergabe dieser Mail ist nicht gestattet.
>
> This e-mail may contain confidential and/or privileged information. If you
> are not the intended recipient (or have received this e-mail in error)
> please notify the sender immediately and destroy this e-mail. Any
> unauthorised copying, disclosure or distribution of the material in this
> e-mail is strictly forbidden.
|