Date: Wed, 15 Feb 2006 03:15:59 -0500
Reply-To: sbarry@sbbworks.com
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Scott Barry <sbarry@SBBWORKS.COM>
Organization: SBBWorks, Inc.
Subject: Re: To check whether dataset exist or not in JCL
Content-Type: text/plain; charset="us-ascii"
You can accomplish the task but it requires two job-steps, one conditional
(the RENAME), as shown below.
Regards,
Scott Barry
SBBWorks, Inc.
//STEP1 EXEC SAS
//INPUT DD DISP=SHR,DSN=SBB0315.SAS.TEST
//SYSIN DD *
%MACRO X;
DATA _NULL_;
%IF %SYSFUNC(FILEREF(INPUT)) %THEN
PUT '>INFO> NOT IN JCL.';
%ELSE
ABORT RETURN 4;
RUN;
%MEND X;
%X;
// IF RC > 0 THEN
//* ONLY EXECUTE RENAME, IF DSN ALLOCATED IN PRIOR SAS STEP,
//* INDICATED BY COND CODE 0004.
//STEP1 EXEC PGM=IKJEFT01
//SYSIN DD *
RENAME SAS.TEST SAS.TEST1
/*
// ENDIF
From: chethan.gurumur...@gmail.com
Hi JCL Friends,
It would be a great help if u could solve my problem.
Following is the problem i do have....
Before reading or creating any dataset in the program i want to check
whether the particular dataset exist or not.IS there any function to
check whether the dataset exist or not.
The following is the stuff i want to do.
If the dataset exist then rename dataset X to y,and continue with the
remaining statements.
If the dataset doesn't exist then write the dataset doesn't
exist...then comeout of the program.
Thanks a lot well in advance.
Chethan