Desktop productivity for business analysts and programmers

How to read Mainframe file name in SAS

Reply
New Contributor
Posts: 2

How to read Mainframe file name in SAS


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.

PROC Star
Posts: 1,146

Re: How to read Mainframe file name in SAS

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

New Contributor
Posts: 2

Re: How to read Mainframe file name in SAS

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

Super User
Super User
Posts: 6,851

Re: How to read Mainframe file name in SAS

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;

PROC Star
Posts: 1,146

Re: How to read Mainframe file name in SAS

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

Ask a Question
Discussion stats
  • 4 replies
  • 1641 views
  • 0 likes
  • 3 in conversation