BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi all,

Recently we migrated our SAS software from SAS8.2 to SAS9.2. We use SAS under Z/OS. Below is the problem description,

I have a JCL with two steps,

Step1: Execute a sas program (say SASPGM1). I have specified a work library for this step. SASPGM1 creates an intermittent SAS dataset (e.g. DATASET1);
Step2: Execute another SAS program (say SASPGM2). Here I use the same work library as used in step1. But when I try to access the intermittent sas dataset (dataset1) created in step1, the program fails stating that WORK.DATASET1.DATA does not exist.

The same JCL works fine with SAS8 but not with SAS9.2. Below is the sample JCL:

//STEPA EXEC SAS
//WORK DD DSN=&&WORKLIB,DISP=(,PASS),UNIT=DISK
//SYSIN DD DSN=HLQ1.HLQ2.SAS(SASPGM1),DISP=SHR
//*
//STEPB EXEC SAS
//WORK DD DSN=&&WORKLIB,DISP=(OLD,KEEP)
//SYSIN DD DSN=HLQ1.HLQ2.SAS(SASPGM2),DISP=SHR

I have workarounds, but I want to know why is this not working.
2 REPLIES 2
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Since you are passing the SAS "WORK" allocated library, I expect your SAS CONFIG option WORKINIT is specified, rather than a previous default-behavior of NOWORKINIT.

If this is the case, your next option might be to discuss the default-assignment change with your SAS System Administrator. Then you can decide if your situation requires you to code NOWORKINIT or you may need to change from using WORK to some other LIBNAME that is not so dependent on the SAS system.


Scott Barry
SBBWorks, Inc.

//S1 EXEC SAS913
//WORK DD DSN=&&WORK,DISP=(NEW,PASS)
//SYSIN DD DATA,DLM=ZZ
%PUT %SYSFUNC(GETOPTION(WORKINIT));
DATA WORK.DUMMY;
DUMMY=1;
RUN;
ZZ
//S2 EXEC SAS,OPTIONS=WORKINIT
//WORK DD DSN=&&WORK,DISP=OLD
//SYSIN DD DATA,DLM=ZZ
DATA ;
SET WORK.DUMMY;
RUN;
%PUT %SYSFUNC(GETOPTION(WORKINIT));
ZZ
deleted_user
Not applicable
Thanks a lot. This was very helpful.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 2 replies
  • 703 views
  • 0 likes
  • 2 in conversation