BookmarkSubscribeRSS Feed
CharlesYu
Calcite | Level 5

Hi, Experts,

 

I'm unfamiliar with mainframe, and need some help understanding how to pull data from it. This might be a pretty basic question.

 

I have code working to connect:

 

%let sas_version =SAS94;
%let spawner_name = spawner;

OPTIONS SYMBOLGEN;

%let sy51=[xxxxx.xxxxx.xx.xxxx.xx];

/*
[some code to set &mainframe_user_id and &mainframe password]
*/

Signon sy51.spawner user="&Mainframe_user_id." password="&MAINFRAME_PASSWORD.";

rsubmit sy51.spawner;

proc setinit;
run;quit;

endrsubmit;

signoff &srvr..spawner;

^^that gives me a proc setinit for the mainframe, which is good.

 

Now, the user I'm (trying to) help tells me that there are datasets I need to access at some location on the mainframe. They look like:

 

abc.def.ghijk.lnm154.something.

 

How do I go about either writing a libname or importing these datasets?

 

Thanks in advance!

3 REPLIES 3
Kurt_Bremser
Super User

When you access the file, start the name with a single quote

libname xxx "'abc.def.ghijk.lnm154.something";

The single quote tells the system not to search in your "tree" (which starts with the MF username), but from the "root".

jimbarbour
Meteorite | Level 14

@Kurt_Bremser wrote:

When you access the file, start the name with a single quote

libname xxx "'abc.def.ghijk.lnm154.something";

The single quote tells the system not to search in your "tree" (which starts with the MF username), but from the "root".


It's been a few years since I've worked on a mainframe, but I believe you would then refer to the SAS dataset as  xxx.something inside your SAS program.  Borrowing from @Kurt_Bremser's code, something like this:

libname xxx "'abc.def.ghijk.lnm154.something";

DATA Want;
    SET  xxx.something;
RUN;

Jim

 

Patrick
Opal | Level 21

From the SAS z/OS docu Assigning SAS Libraries Internally

 

And if you need to transfer the SAS datasets to your client environment then refer to the SAS\Connect docu (i.e. Remote Library Services or Proc Download).

 

....and should your data on the client side look "garbled" then best talk to someone at your site who's done such a transfer before (prior to getting into Proc Trantab and all the lovely encoding and codepage stuff).

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 818 views
  • 2 likes
  • 4 in conversation