08-15-2013 07:39 AM
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;
input @1 var1 $ebcdic8.;
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.
08-15-2013 08:13 AM
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.
08-15-2013 08:40 AM
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).
08-15-2013 08:46 AM
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.
08-15-2013 04:01 PM
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).