MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Check whether Dataset is existed or not
Goto page Previous  1, 2
 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
anbesivam
Beginner


Joined: 09 Aug 2006
Posts: 66
Topics: 14

PostPosted: Thu Aug 17, 2006 11:17 am    Post subject: Reply with quote

Hi superk,

Hope you are not understand the problem.

I need to pass ddname from JCL to my rexx program and I have to check DSN is exist or not in my REXX program.

As per above senario, Possitive contion is working for me. But negative condition is not worked because if I am not giving DISP for my dataset, it will be newly created.

Is there any possible way to do this ?
Back to top
View user's profile Send private message
coolman
Intermediate


Joined: 03 Jan 2003
Posts: 283
Topics: 27
Location: US

PostPosted: Thu Aug 17, 2006 11:25 am    Post subject: Reply with quote

anbesivam,

Please post your full JCL that you are using to execute the rexx program
________
trichomes pictures


Last edited by coolman on Sat Feb 05, 2011 1:48 am; edited 1 time in total
Back to top
View user's profile Send private message
anbesivam
Beginner


Joined: 09 Aug 2006
Posts: 66
Topics: 14

PostPosted: Thu Aug 17, 2006 11:57 am    Post subject: Reply with quote

Please find my JCL
Code:

//RBDRCHK1 EXEC PGM=IKJEFT01                                 
//ISPPROF   DD DSN=&&PROF,UNIT=SYSDA,SPACE=(TRK,(5,5,5)),   
//             RECFM=FB,LRECL=80                             
//ISPSLIB   DD DISP=SHR,DSN=PL.NPL.PROD.SLIB                 
//          DD DISP=SHR,DSN=ISP.SISPSENU                     
//ISPPLIB   DD DISP=SHR,DSN=PL.NPL.PROD.PLIB                 
//          DD DISP=SHR,DSN=ISP.SISPPENU                     
//ISPMLIB   DD DISP=SHR,DSN=PL.NPL.PROD.MLIB                 
//          DD DISP=SHR,DSN=ISP.SISPMENU                     
//ISPTLIB   DD DISP=SHR,DSN=ISP.SISPTENU                     
//DD1       DD DSN=XXXXXXX.TEST.JCL,DISP=SHR --> Existing
//*DD1      DD DSN=XXXXXXX.TEST.JCL123       --> Non Existing
//SYSPRINT  DD SYSOUT=*                                     
//SYSTSPRT  DD SYSOUT=*                                     
//SYSEXEC  DD DSN=XXXXXXX.TEST.REXX.EXEC,DISP=SHR           
//SYSTSIN DD *                                               
 ISPSTART CMD(%REXXTEST DD1)                                 
/*                                                                           

And following is my REXX code
Code:

/* REXX*/                     
ARG PDSNAME                   
 CALL LISTDSI(PDSNAME FILE)   
  DNAME = SYSDSNAME           
 RC = SYSDSN(" ' "DNAME" ' ")     
 SAY 'RC ' RC
Back to top
View user's profile Send private message
semigeezer
Supermod


Joined: 03 Jan 2003
Posts: 1014
Topics: 13
Location: Atlantis

PostPosted: Thu Aug 17, 2006 12:22 pm    Post subject: Reply with quote

Why do you have spaces around the single quotes? Also, since this is not an ISPF program, you don't need the ISPF data sets or the ISPSTART CMD() invocation. In any event, the job will fail if the data set specified by a dd statement with disp=old or mod does not exist. Your program will never be executed.
Back to top
View user's profile Send private message Visit poster's website
anbesivam
Beginner


Joined: 09 Aug 2006
Posts: 66
Topics: 14

PostPosted: Thu Aug 17, 2006 1:13 pm    Post subject: Reply with quote

Yes, I feel the same. Rolling Eyes

If Possible, Could you please provide JCL for running REXX program other than above one.

Thanks in advance.
Back to top
View user's profile Send private message
anbesivam
Beginner


Joined: 09 Aug 2006
Posts: 66
Topics: 14

PostPosted: Fri Aug 18, 2006 4:47 am    Post subject: Reply with quote

Thanks so much to each and every one for spending your time for me. Smile
All the inputs given by you are valuable for me.

I have found the REXX run jcl.
Back to top
View user's profile Send private message
Steve Coalbran
Beginner


Joined: 09 Mar 2005
Posts: 22
Topics: 0
Location: Stockholm, Sweden

PostPosted: Mon Aug 21, 2006 1:34 pm    Post subject: Reply with quote

Here's a technique I use to define a generic dsname from JCL...
Code:

//         SET MD='(MOD,DELETE),SPACE=(TRK,0)'
...
//SOMEPROC PROC PRJ1=,LIB1=
...
//S030     EXEC PGM=IKJEFT1A,PARM=REXXBIT
//SYSMASK  DD DISP=&MD,DSN=&PRJ1..&LVL1..M-A-S-K
...

in the REXX executed by this step...
Code:

RC = LISTDSI("SYSMASK FILE")
IF( RC<>0 )THEN EXIT 16
pm = POS("M-A-S-K",sysdsname)
pfx = LEFT(sysdsname,pm-1)
ids = "'"pfx".INPUT'" 
ods = "'"pfx".OUTUT'"
dc = LISTDSI(ids "RECALL SMSINFO")   
dc = LISTDSI(ods "RECALL SMSINFO")
IF( SYSDSN(ids)<>"OK" ,
    SYSDSN(ods)="OK" )THEN EXIT 8
"ALLOC DD(IDS) DS("ids") SHR REUSE"
attr = "LRECL(80) RECFM(F B) BLKSIZE(3120) SPACE(30)TRACKS"
"ALLOC DD(ODS) DS("ods") NEW REUSE" attr   
....

...get the picture?...
As the catalogued JCL procedure and exec are promoted from development->systest->acctest->prod (if it's a nicely library managed shop with buckets of QA and change control tickets... luvly-jubbly... then the PRJ1 and LVL1 will change (or the LVL1 anyhow) thus allowing you generic definition of the datasets.

Wink /Steve Cool
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF All times are GMT - 5 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group