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 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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