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

Extracting Information from DD Statements for SAS Processing


IBM Mainframe Forums -> All Other Mainframe Topics
Post new topic   Reply to topic
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
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: 1742
Location: Tirupur, India

PostPosted: Thu Apr 14, 2016 12:49 am
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
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: 1742
Location: Tirupur, India

PostPosted: Thu Apr 14, 2016 12:58 am
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: 1742
Location: Tirupur, India

PostPosted: Thu Apr 14, 2016 1:13 am
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
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

Active Member


Joined: 01 Sep 2015
Posts: 712
Location: Denmark

PostPosted: Thu Apr 14, 2016 1:48 pm
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: 1742
Location: Tirupur, India

PostPosted: Thu Apr 14, 2016 4:28 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> All Other Mainframe Topics

 


Similar Topics
Topic Forum Replies
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts Capturing Job Execution Information All Other Mainframe Topics 3
No new posts Help in extracting data between doubl... DFSORT/ICETOOL 5
No new posts Extracting Compression Statistics fro... PL/I & Assembler 2
Search our Forums:

Back to Top