Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Extracting Information from DD Statements for SAS Processing

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics
View previous topic :: :: View next topic  
Author Message
Charles Wolters

New User


Joined: 30 Mar 2011
Posts: 48
Location: United States

PostPosted: Wed Apr 13, 2016 10:21 pm    Post subject: Extracting Information from DD Statements for SAS Processing
Reply with quote

I have 25 SAS data libraries and they all have the same file structure. The naming convention is as follows:

RMTPRD.EES.S688CLW.VIREC.VAHLTH.MMMYYYY.DATA

where MMMYYY would be something as APR2016.

The 5 latest libraries we have received use a new coding system for several of the variables which means that the SAS processing will be somewhat different than the processing under the older coding system found on the first 20 mainframe data sets. I know the first data set using the new coding system was OCT2015 and all subsequent data I have received and will receive in the future will use the new coding system.

Ideally I would like to process all 25 data sets in one job but I am having problems determining how the data set information can be passed to SAS so that the correct SAS processing stream can be used.

Charles Wolters
Back to top
View user's profile Send private message

vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1445
Location: Azeroth

PostPosted: Thu Apr 14, 2016 12:49 am    Post subject:
Reply with quote

Quote:
Ideally I would like to process all 25 data sets in one job

Hi, Do all the 25 sas datasets have 25 different DD names on the JCL?
Back to top
View user's profile Send private message
Charles Wolters

New User


Joined: 30 Mar 2011
Posts: 48
Location: United States

PostPosted: Thu Apr 14, 2016 12:53 am    Post subject: Re:Extracting Information from DD Statements for SAS Process
Reply with quote

Vasanthz,

Yes, they all have different DD names on JCL.

Charles Wolters
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1445
Location: Azeroth

PostPosted: Thu Apr 14, 2016 12:58 am    Post subject:
Reply with quote

Could you show how the 25 datasets are read into the program, a single SET statement or multiple SET statements?

For starters, you can interrogate the physical filename from DD name via the below program.

Code:
PROC SQL;
SELECT PATH FROM SASHELP.VLIBNAM WHERE LIBNAME = 'DDNAME'
       AND UPCASE(SYSNAME) = 'UNIT';
QUIT;



If you could give some more info on how different DD names are read, then we could suggest a more specific technique.
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1445
Location: Azeroth

PostPosted: Thu Apr 14, 2016 1:13 am    Post subject:
Reply with quote

For the below DD name,
Code:
//WELLS   DD   DISP=SHR,DSN=PRETTY.SAS.DATASET

A sas program
Code:
PROC SQL;
SELECT PATH FROM SASHELP.VLIBNAM WHERE LIBNAME = 'WELLS'
       AND UPCASE(SYSNAME) = 'UNIT';
QUIT;


Will give below output
Code:
path
------------
PRETTY.SAS.DATASET


You could build upon this technique, by passing the dataset name into a macro variable.
Check PROC SQL section using :INTO clause

Based on the value of Macro variable, you can do differnt coding for different names
Back to top
View user's profile Send private message
Charles Wolters

New User


Joined: 30 Mar 2011
Posts: 48
Location: United States

PostPosted: Thu Apr 14, 2016 1:28 am    Post subject: Re:Extracting Information from DD Statements for SAS Process
Reply with quote

Vasanthz,

That sounds like a plan. Yes, once you build your list of data sets you can use :INTO clause to create your macro variable. Let me follow through on this and I will get back to you if I run into a snag.

I have never used the VLIBNAM view from SASHELP and I thought that for this technique to work one would have to specify LIBNAME statements in the SAS program rather than DD statements in the JCL. I learned something today.

Charles Wolters
Back to top
View user's profile Send private message
Willy Jensen

New User


Joined: 01 Sep 2015
Posts: 94
Location: Switzerland

PostPosted: Thu Apr 14, 2016 1:48 pm    Post subject:
Reply with quote

Been a while, but I seem to remember a READJFCB option on the INFILE statement. So you could interrogate the datasetname in a DATA step.
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1445
Location: Azeroth

PostPosted: Thu Apr 14, 2016 4:28 pm    Post subject:
Reply with quote

Hi Charles,
There is also a simpler approach to get the file name

Code:
//STEP1    EXEC SAS
//WELLS    DD DSN=WELLS.SAS.PDB,DISP=SHR
//SYSIN DD *
DATA _NULL_;
LENGTH PHYS_NAME $44;
INFILE WELLS FILENAME=PHYS_NAME;
INPUT;
CALL SYMPUT('PHYS_NAME',PHYS_NAME);
STOP;
RUN;

%PUT THE PHYSICAL FILE NAME IS  &PHYS_NAME;


Output:
Code:
THE PHYSICAL FILE NAME IS  WELLS.SAS.PDB
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Run stats processing on zIIP Engine Virendra Shambharkar DB2 9 Fri Oct 14, 2016 10:24 am
No new posts Obtaining file information pahiker COBOL Programming 25 Tue Sep 27, 2016 7:25 pm
No new posts DB2 Streaming Batch Processing Problem Manshadi DB2 4 Sat Sep 24, 2016 12:14 pm
No new posts Need information on COBOL MOVE CORRES... subratarec COBOL Programming 10 Tue Jun 28, 2016 10:38 pm
No new posts Symbolic Parameters in SYSIN DD state... madishpa DFSORT/ICETOOL 3 Mon Jun 27, 2016 6:23 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us