LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (October 1998, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 6 Oct 1998 19:13:42 -0400
Reply-To:     MICHAEL.RAITHEL@RAITHM49.CUSTOMS.SPRINT.COM
Sender:       "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From:         "Michael A. Raithel" <MICHAEL.RAITHEL@RAITHM49.CUSTOMS.SPRINT.COM>
Subject:      (MVS) Re: Dataset names & job names in  MVS,  JCL.

Walter SCHRENK posted the following:

>Hi to all SAS MVS professionals! > >How can I use dataset names & job names in Batch mode >dynamically, eg. in a put statement: > >put dataset $.; > >to avoid to change the program if it runs with different >JCL (one program must run with various JCLs) >

Hi to you, Walter! When I have to build tricky JCL that needs dynamically built data set names, I use the MVS internal reader. That is; I build the data set names and JCL within a SAS program and send the JCL to the internal reader, where it "becomes" a new batch job and is executed.

Here is an example of what such a job looks like:

//STEP01 EXEC SAS //INTRDR DD SYSOUT=(A,INTRDR) //SYSIN DD *

...SAS code to create DSN's as macro variables...

DATA _NULL_; FILE INTRDR LRECL=80 BLKSIZE=80 RECFM=F NOPRINT NOTITLES;

PUT "//JOB1 JOB (JAMES,123),'WALTER PROD JOB01',CLASS=A, "; PUT '// MSGCLASS=Q, '; PUT "//STEP09 EXEC SAS,WORK='750,100' "; PUT "//TAPE1 DD DISP=SHR,DSN=TAPE.&TAPNAM1,DISP=SHR "; PUT "//TAPE2 DD DISP=SHR,DSN=TAPE.&TAPNAM2,DISP=SHR "; PUT '// UNIT=AFF=TAPE1 '; PUT "//TAPE3 DD DISP=SHR,DSN=TAPE.&TAPNAM3,DISP=SHR "; PUT '// UNIT=AFF=TAPE2 '; PUT '//SYSIN DD DSN=JAMES.SASPROG.PDS(TAPEPRGM),DISP=SHR'; //*

Walter, when the above SAS code executes, the tape dataset name macro variables are programatically determined by... um, "your" code. They are then resolved in the DATA _NULL_ step, where the program "PUT"s the canned JCL to the internal reader. The JCL put to the internal reader is released for execution as a new batch job. This works quite well, and is a great trick to show your COBOL programming friends!

The beauty of having the Internal Reader at your disposal is that, for the price of a single production job, you can send scores of dynamically tailored batch jobs hurtling towards your business processing targets. And, you do not have to bother the busy Production Control staff with those pesky "Production JCL Change Request" forms or those burdensome "New Production Job Request" forms...

Walter, good luck in using the power and the might of the SAS System in the MVS environment to dynamically create batch jobs!

I hope that this suggestion proves helpful now, and in the future!

Of course, all of these opinions and insights are my own, and do not reflect those of my organization or my associates.

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Michael A. Raithel "The man who wrote the book on performance" E-mail: maraithel@mcimail.com Author: Tuning SAS Applications in the MVS Environment +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ...so let me in from the cold, turn my lead into gold... +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


Back to: Top of message | Previous page | Main SAS-L page