IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Jcl for a SAS program


IBM Mainframe Forums -> All Other Mainframe Topics
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
krakesh06

New User


Joined: 05 Feb 2007
Posts: 2
Location: Pune

PostPosted: Thu Jul 01, 2010 5:57 pm
Reply with quote

Hi All,

I would like to seek an information from you all on how to write a SAS JCL. Can I get a sample of a SAS JCL.

I will be using the SAS programming for all the data manipulation (DML) tasks.

Thanks
Rakesh
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8796
Location: Welsh Wales

PostPosted: Thu Jul 01, 2010 5:59 pm
Reply with quote

You need to ask YOUR site support people. They are the ones that set it all up.

How are we supposed to know which load libraries or JCL PROCS they have defined.
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Thu Jul 01, 2010 6:29 pm
Reply with quote

Usually you just execute the SAS PROC:

//SASSTEP EXEC SAS
//SYSIN DD *
sas code ...
/*
//*
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Thu Jul 01, 2010 10:41 pm
Reply with quote

Hope you can use this SAS jcl (it worked for me) :

Code:

//STEP03   EXEC PGM=SASXA1,                                             00020000
//             PARM='SORT=4',                                           00030000
//             REGION=6M                                                00040000
//NULLPDS  DD  DSN=&&NULLPDS,                                           00050000
//             DISP=(MOD,PASS),                                         00060000
//             UNIT=SYSDA,                                              00070000
//             SPACE=(TRK,(1,1,1)),                                     00080000
//             DCB=BLKSIZE=6160                                         00090000
//STEPLIB  DD  DSN=*.NULLPDS,                                           00100000
//             DISP=(SHR,PASS),                                         00110000
//             VOL=REF=*.NULLPDS                                        00120000
//         DD  DSN=xxxxx.SAS.SASLOAD,                                   00130000
//             DISP=SHR                                                 00140000
//         DD  DSN=xxxxxxxx.xxxxxxxx.xx.SAS.LOADLIB,                    00150000
//             DISP=SHR                                                 00160000
//CONFIG   DD  DSN=xxxxxxxx.SASA3##1.SASCONF(SAS609B),                     00170000
//             DISP=SHR                                                 00180000
//         DD  DSN=NULLFILE,                                            00190000
//             DISP=SHR                                                 00200000
//SASAUTOS DD  DSN=*.NULLPDS,                                           00210000
//             DISP=(SHR,PASS),                                         00220000
//             VOL=REF=*.NULLPDS                                        00230000
//         DD  DSN=xxxxxxxx.SAS.SASAUTO,                                00240000
//             DISP=SHR                                                 00250000
//SASHELP  DD  DSN=xxxxxxxx.SAS.SASHELP,                                00260000
//             DISP=SHR                                                 00270000
//SASMSG   DD  DSN=xxxxxxxx.SAS.SASMSG,                                 00280000
//             DISP=SHR                                                 00290000
//WORK     DD  DSN=xxxxxxxx.WORK.xxxxxxxx,                              00300000
//             DISP=(,DELETE),                                          00310000
//             UNIT=DASD,                                               00320000
//             AVGREC=K,                                                00330000
//             SPACE=(32256,(50,5)),                                    00340000
//             DCB=BLKSIZE=0                                            00350000
//FT11F001 DD  SYSOUT=*                                                 00360000
//FT12F001 DD  SYSOUT=*                                                 00370000
//FT15F001 DD  DATACLAS=DCALNM,                                         00380000
//             DCB=(RECFM=FB,LRECL=80,BLKSIZE=400,BUFNO=1)              00390000
//SYSUDUMP DD  SYSOUT=P                                                 00400000
//OPCCP    DD  DSN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx(0),                 00410000
//             DISP=SHR                                                 00420000
//OPCLTP   DD  DSN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx(0),                00430000
//             DISP=SHR                                                 00440000
//WS       DD  DSN=xxxxxxxxxxxxxxxxx,                                   00450000
//             DISP=SHR                                                 00460000
//AD       DD  DSN=xxxxxxxxxxxxxxxxx,                                   00470000
//             DISP=SHR                                                 00480000
//MACLIB   DD  DSN=xxxxxxxxxxxxxxxxxxxxxxxxxxx,                         00490000
//             DISP=SHR                                                 00500000
//PSBXREF  DD  DSN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx,           00510000
//             DISP=SHR                                                 00520000
//PROCOPT  DD  DSN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx,           00530000
//             DISP=SHR                                                 00540000
//DDNAMES  DD  DSN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx,           00550000
//             DISP=SHR                                                 00560000
//DBDXREF  DD  DSN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx,           00570000
//             DISP=SHR                                                 00580000
//DBDLIST  DD  DSN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx,           00590000
//             DISP=SHR                                                 00600000
//PSBLIST  DD  DSN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx,           00610000
//             DISP=SHR                                                 00620000
//DEDBLIST DD  DSN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxx,                       00630000
//             DISP=SHR                                                 00640000
//TRANSA1  DD  DSN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx                 00650000
//             DISP=SHR                                                 00660000
//TRANSA3  DD  DSN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx,                 00670000
//             DISP=SHR                                                 00680000
//TRANSFC  DD  DSN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx,                 00690000
//             DISP=SHR                                                 00700000
//TRANSFG  DD  DSN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx,                 00710000
//             DISP=SHR                                                 00720000
//JCLCHECK DD  DSN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx,                    00730000
//             DISP=SHR                                                 00740000
//PROCTAB  DD  DSN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx,               00750000
//             DISP=SHR                                                 00760000
//DYNLIBS  DD  DSN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx,               00770000
//             DISP=SHR                                                 00780000
//CCDLIBS  DD  DSN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx,               00790000
//             DISP=SHR                                                 00800000
//JCLLIBS  DD  DSN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx,               00810000
//             DISP=SHR                                                 00820000
//DYNMEM   DD  DISP=MOD,                                                00830000
//             DATACLAS=DCALNS,                                         00840000
//             DCB=(RECFM=FB,LRECL=80,BLKSIZE=6160)                     00850000
//CCDMEM   DD  DISP=MOD,                                                00860000
//             DATACLAS=DCALNS,                                         00870000
//             DCB=(RECFM=FB,LRECL=80,BLKSIZE=6160)                     00880000
//SASLIB   DD  DSN=xxxxxxxx.SYN.SASSORT,                                   00890000
//             DISP=SHR                                                 00900000
//SYSIN    DD  DSN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx,               00910000
//             DISP=SHR                                             
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8796
Location: Welsh Wales

PostPosted: Fri Jul 02, 2010 11:30 am
Reply with quote

Peter, it failed for me

STEPLIB +001 Dataset not found

icon_biggrin.gif icon_lol.gif icon_biggrin.gif icon_lol.gif icon_biggrin.gif
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Fri Jul 02, 2010 11:47 am
Reply with quote

Expat,

thats a very nice one. icon_cool.gif
Back to top
View user's profile Send private message
krakesh06

New User


Joined: 05 Feb 2007
Posts: 2
Location: Pune

PostPosted: Thu Jul 15, 2010 4:58 pm
Reply with quote

expat wrote:
You need to ask YOUR site support people. They are the ones that set it all up.

How are we supposed to know which load libraries or JCL PROCS they have defined.
----------

I just want a model of it, I will take care of the libraries name you can write any dummy library name. I wanted to know the possible ways of writing a SAS JCL, in case of passing parameters to program , using SYSIN DD * for passing data etc.....
Thanks for all of your information.

Thanks
Rakesh
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8700
Location: Dubuque, Iowa, USA

PostPosted: Thu Jul 15, 2010 5:16 pm
Reply with quote

Quote:
I just want a model of it, I will take care of the libraries name you can write any dummy library name. I wanted to know the possible ways of writing a SAS JCL, in case of passing parameters to program , using SYSIN DD * for passing data etc.....
I have no idea what you mean by this. The simplest way to write SAS JCL is (as Kevin showed):
Code:
// EXEC SAS
//SYSIN DD *
<SAS statements>
/*
If you need to read a file, or write a file, you may need the DD statement for the file (depending upon how you write your SAS code, however, that is not a requirement). SAS has a wide set of parameters that can be set for various reasons, and they can be passed by PARM= or a SAS OPTIONS ... ; statement. Production code rarely uses SYSIN for passing data since the SAS code is read from SYSIN.

As far as the procedure posted by PeterHolland, it is a version 6.09 procedure and therefore dates back many years (2001 or 2002 if I remember correctly). The current release of SAS is 9.2 and the SAS JCL procedure was completely rewritten either in SAS 9.1.3 or 9.2 . Hence if you're using one of these releases you would be better off contacting your site support group for assistance.

If you explain better just what you are looking for, we probably could help you better. Since SAS can be invoked from TSO or a batch job or on a PC or on a Unix machine, you need to clarify your question.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8796
Location: Welsh Wales

PostPosted: Thu Jul 15, 2010 5:59 pm
Reply with quote

I hate to be pedantic (well sort of icon_wink.gif ), but, I tried EXEC SAS and it failed because the PROC here is called by a different name.

That is why I suggested that the OP spoke to the people who actually set the darned thing up.

At one site we had EXEC SAS8 and EXEC SAS9 until the conversion was completed when SAS8 suddenly disappeared one dark night
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Thu Jul 15, 2010 7:15 pm
Reply with quote

At our company nested procs were not allowed, hence the jcl i showed.
(by the way expat EXEC SAS worked all the time, but proc naming
is site depending i guess).
And im not sure that the SAS procs (delivered by SAS) were totally rewritten for new versions like Robert states, I really would like to see
a sample of that.
Back to top
View user's profile Send private message
poorani M

New User


Joined: 02 Sep 2010
Posts: 1
Location: Chennai

PostPosted: Thu Dec 02, 2010 4:54 pm
Reply with quote

If you are looking out for examples to plug into the SYSIN in the jcl, this would be helpful:
//step1 EXEC SAS
//FT12F001 DD SYSOUT=<output dataset Name>
//IN1 DDDSN=<input dataset name>,DISP=SHR
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSIN DD *

OPTIONS PAGESIZE=24;

DATA INPUT;
INFILE IN1 LENGTH=LINELEN;
INPUT @01 PRODUCT ABC.;

PROC FREQ DATA=INPUT;
TITLE 'FREQUENCY OF PRODUCTS ';
TABLES PRODUCT;
RUN;
//*
//*


The above JCL tries to pull the frequency of various products. The frequency is the number of times the value appears for the product. The output is obtained as below


The FREQ Procedure

Cumulative Cumulative
PRODUCT Frequency Percent Frequency
------------------------------------------------------------
1 3310 8.37 3310 8.37
2 1111 2.81 4421 11.18
3 4340 10.98 8761 22.16
4 2242 5.67 11003 27.82
45 540 1.37 11543 29.19
etc...
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8796
Location: Welsh Wales

PostPosted: Thu Dec 02, 2010 5:18 pm
Reply with quote

poorani M

You have resurected a happily dormant topic with a response that bears absolutely no corelation to the original problem.

Any particular reason ?
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> All Other Mainframe Topics

 


Similar Topics
Topic Forum Replies
No new posts Error to invoke MPP program through B... IMS DB/DC 3
No new posts Using API Gateway from CICS program CICS 0
No new posts DB2 Event passed to the Application P... DB2 1
No new posts How to pass the PARM value to my targ... COBOL Programming 8
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
Search our Forums:

Back to Top