BookmarkSubscribeRSS Feed
ChVenu
Calcite | Level 5


Hi,

I want to read a mainframe GDG file name in SAS. Is there any specfic code or command to achive this task? I have read about JFCB option but this works only in Mainframe SAS but not in Windows SAS.

Can any one please help me on this...

Thanks,

Venu.

4 REPLIES 4
TomKari
Onyx | Level 15

Hey, you actually found someone who knows what a GDG is!

What do you mean that you want to "read" the filename. I assume this is different from reading the file? Where are you trying to read it from?

Tom

ChVenu
Calcite | Level 5

Hi Tom,

I'm trying to read a mainframe file(Z/OS file) from SAS EG. GDG is nothing but genaration data groups where multiple versions of the files will be generated as shown below..

OPSDESK.PHONES.UNPAIRED        

OPSDESK.PHONES.UNPAIRED.G0001V00

OPSDESK.PHONES.UNPAIRED.G0002V00

OPSDESK.PHONES.UNPAIRED.G0003V00

OPSDESK.PHONES.UNPAIRED.G0004V00

OPSDESK.PHONES.UNPAIRED.G0005V00

OPSDESK.PHONES.UNPAIRED.G0006V00

Requirement:-

Every day tehre is a new version available which I need to read. To make sure that the file i'm reading is not the same one which I have read yesterday I want to save the file name which I have read so that I can do a compre with the file names next time before its goes on with further execution.

Please let me know if my query is not clear

Tom
Super User Tom
Super User

Does the FILENAME option on the INFILE statement help?  Try something like this to test.  If you are lucky you can use relative reference in the DD statement and SAS will display the absolute reference in the value of the FILENAME variable.

//MYFILE DD DSN=.....

....

data _null_;

   length filename $200 ;

   infile myfile filename=filename;

   input;

   put filename=;

  stop;

run;

TomKari
Onyx | Level 15

There's still something I'm missing. You're running SAS EG on your Windows PC, accessing a Generation Data Set, presumably sitting on a z/os mainframe.

1. What SAS server is your EG session using? What OS does it run?

2. How are you creating the link to your Generation Data Set? Do you use an INFILE statement in SAS code?

If it is code that you've created, could you post it?

Thanks,

  Tom

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 3669 views
  • 0 likes
  • 3 in conversation