Sysntax to use multiple input datasets while running SAS program

Discussion of Dovetailed Technologies Dataset Pipes tools
VikrFID
Posts: 2
Joined: Fri May 13, 2016 11:30 pm

Sysntax to use multiple input datasets while running SAS program

Postby VikrFID » Sun May 15, 2016 11:48 pm

Hello,

Could anyone please share the syntax on how to give multiple input or output files used in a SAS code.

The JCL code snippet looks like this which I am trying to convert and run in Hybrid Z/OS environment.
Please let know how the output files have to be given in "todsn" and "fromdsn" format.

STEP004 EXEC SAS,WORK='100,50'
IN1 DD DSN=XXX.FILE.OUT,DISP=SHR
OUT1 DD DSN=XXX2.FILE.TEMP1,DISP=(NEW,CATLG,DELETE),
DCB=(RECFM=FB),
SPACE=(CYL,(25,25),RLSE),UNIT=3390
OUT2 DD DSN=XXX3.TMP.SASDATA,DISP=(NEW,CATLG,DELETE),
SPACE=(CYL,(25,25),RLSE),UNIT=3390
*

dovetail
Site Admin
Posts: 1707
Joined: Thu Jul 29, 2004 12:12 pm

Re: Sysntax to use multiple input datasets while running SAS program

Postby dovetail » Mon May 16, 2016 11:57 am

Have you looked at this information? -
http://www.dovetail.com/products/casestudysas.html

If so, do you have the sample "SAS Population Data" program working?
- Do this first to make sure that your environment is set up correctly

Then, assuming that OUT1 and OUT2 are text files:

- First, I think that you will need to specify LRECL on these in your JCL DCB parameter
- You should be able to modify the example DD:SYSIN to this for your files:

Code: Select all

//STDIN DD *
PGM=/usr/local/wps-3.0.0.2/bin/wps
#PGM=/usr/local/sas91/sas
sysin=/tmp/coz.$$.$random.sas
mkfifo $sysin
trap 'rm -rf -f $sysin' EXIT
fromdsn DD:SYSIN > $sysin &

OUT1=>(todsn DD:OUT1) \
OUT2=>(todsn DD:OUT2) \
$PGM -print >(toasa | todsn -z DD:SASLIST) \
-log >(todsn -z DD:SASLOG) \
-logparm "write=immediate" \
$sysin
//*


Note: As you can see, using this requires some knowledge of how to use Bash shell scripting on the target UNIX environment.
In the shell script, "OUT1", and "OUT2" are prefix-environment variables for the SAS program.
The Bash "process substitution" technique (described in the white paper) is used to pass these variables into
the SAS program as the name of temporary pipe files that SAS can read. The pipes are connected back into
z/OS to your DD/data sets.

VikrFID
Posts: 2
Joined: Fri May 13, 2016 11:30 pm

Re: Sysntax to use multiple input datasets while running SAS program

Postby VikrFID » Wed May 18, 2016 8:34 am

Thanks a lot.

Will the declaration be different if the output files are CSV files.

dovetail
Site Admin
Posts: 1707
Joined: Thu Jul 29, 2004 12:12 pm

Re: Sysntax to use multiple input datasets while running SAS program

Postby dovetail » Wed May 18, 2016 8:52 am

The todsn commands shown will, by default, translate text from the target system encoding to the default z/OS EBCDIC encoding.
If this is what you want for you CSV output files, then you should be good.


Return to “Dataset Pipes”

Who is online

Users browsing this forum: No registered users and 1 guest