DATA Step, Macro, Functions and more

How to access a SAS dataset on an IBM mainframe from my PC?

Reply
Contributor
Posts: 44

How to access a SAS dataset on an IBM mainframe from my PC?

I want to access a SAS dataset on an IBM mainframe, from Foundation SAS on my PC. I have successfully used ftp in the past to read text files from the mainframe, with code as follows:

Filename filex ftp "'pr.ap.s010.g0133'" Host="oat1" User="joec" pass='mypass' debug lrecl=1251 recfm=f;

Data Stuff;

     infile filex;

     input @1 var1 $ebcdic8.;

Run;

Can I employ something similar to read SAS datasets from the Mainframe...what's the best way to do that? The SAS library on the mainframe is called EU.OBTEMP.SASBASE and the dataset in there is called shpr.

Thanks

Joe

Super Contributor
Posts: 358

Re: How to access a SAS dataset on an IBM mainframe from my PC?

Posted in reply to mediaeval

Hi:

Some additional information would be helpful...

- do you have SAS on the mainframe as well?

- do you have SAS CONNECT installed?

- do you have a SAS Spawner on the mainframe?

These tools simplify the process of accessing or uploading and downloading files of SAS data from mainframes.

Contributor
Posts: 44

Re: How to access a SAS dataset on an IBM mainframe from my PC?

Hi

Yes, SAS is on the mainframe.

When I run Proc Setinit on my PC, Connect dose not appear in the list of licensed products, so I assume I do not have it. I don't know if the Mainframe is licensed for Connect.

I do not know if there is a SAS Spawner on the mainframe (I've never even heard the term before, I don't have much involvement with mainframe).

Thanks

Joe

Super Contributor
Posts: 358

Re: How to access a SAS dataset on an IBM mainframe from my PC?

Posted in reply to mediaeval

I think the only option for you is to download the file from the mainframe to the PC.  Do you use TSO on the PC to access your mainframe as well?  If so you can use it to download the SAS file but I think there might be conversion issues.  (I haven't done this stuff in years....)

I think you need to download the SAS dataset in binary, or create a transportable copy using PROC EXPORT.

Super User
Posts: 3,260

Re: How to access a SAS dataset on an IBM mainframe from my PC?

I would check out the CPORT and CIMPORT procedures. You need to CPORT the SAS dataset on the mainframe, FTP it to your PC using the BINARY option, then use CIMPORT to read it into SAS on your PC. From memory I think you have to create the CPORT file with a particular record and blocksize, which you should be able to find in the SAS documention (something like RECFM = FB LRECL = 80).

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