BookmarkSubscribeRSS Feed
mediaeval
Calcite | Level 5

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

4 REPLIES 4
OS2Rules
Obsidian | Level 7

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.

mediaeval
Calcite | Level 5

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

OS2Rules
Obsidian | Level 7

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.

SASKiwi
PROC Star

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).

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 4741 views
  • 0 likes
  • 3 in conversation