Page 1 of 3

CallinG REXX thru JCL

PostPosted: Thu Feb 09, 2017 4:18 pm
by arya_starc
I written a simple rexx for listds.
I am pass the dataset thru JCL, but on execution jcl will give the return code of 12.

Below is the rexx code

000100 /*REXX*/                                                                

000200 ADDRESS TSO                                                            

000700     "LISTDS" FILEI "MEMBERS"                                            

002900 SAY "MEMBERS SUCCESSFULLY DISPLAY"                                        

003000 EXIT  
 


Below is the JCL ERROR message

******************************** Top of Data ***********************************

IKJ56701I MISSING DATA SET NAME                                                

READY                                                                          

END                                                                            

 ******************************* Bottom of Data ********************************
 


Please help me so that I will pass the datset thru the JCL

Re: CallinG REXX thru JCL

PostPosted: Thu Feb 09, 2017 7:31 pm
by Akatsukami
And where is the value of filei supposed to be coming from?

Re: CallinG REXX thru JCL

PostPosted: Thu Feb 09, 2017 8:50 pm
by NicC
Search the forum for running Rexx programs in batch.

Re: CallinG REXX thru JCL

PostPosted: Thu Feb 09, 2017 10:30 pm
by Pedro
Show us your JCL.

Re: CallinG REXX thru JCL

PostPosted: Fri Feb 10, 2017 3:41 pm
by arya_starc
below is the jcl


//PAFKREX2 JOB (0000,REXX),'DEV11',CLASS=Y,MSGCLASS=A            
//STEP30 EXEC PGM=IKJEFT01,PARM='LISTDS'                        
//SYSEXEC DD DSN=TS.PAFK.SUSHIL.PDS,DISP=SHR                    
//*OU1    DD DSN=VM.PAC9.OUT.SE1,DISP=SHR                        
//FILEI   DD DSN=VM.LAT.D10A010.PF.JCLLIB.SASH,DISP=SHR          
//SYSPRINT DD SYSOUT=*                                          
//SYSTSPRT DD SYSOUT=*                                          
//SYSTSIN  DD DUMMY                                              
 


edited to remove blank lines and sequence numbers

Re: CallinG REXX thru JCL

PostPosted: Fri Feb 10, 2017 3:53 pm
by NicC
So have you looked in the manual to see how you get your parm (clue: argument) into your program?

And, have you looked through the forum to find the examples that are in here?

Re: CallinG REXX thru JCL

PostPosted: Fri Feb 10, 2017 10:14 pm
by willy jensen
Ok, to get you started.
The JCL parm should have the datasetname i.e. PARM='%LISTDS SYS1.HELP'
In your program after the first line you should have FILEI="'"translate(arg(1))"'"
The assignment of 'filei' from the parm field can be done in many ways, the above is just one. Note that it put quotes around the argument, those are required for the LISTDS command. Also note the percentage sign in the parm field. In my opinion it is bad practice to have a REXX (or CLIST for that matter) with the same name as a program, but the percentage sign tells the interpreter that the name in the parm field is a REXX or CLIST.

Re: CallinG REXX thru JCL

PostPosted: Mon Feb 13, 2017 12:20 pm
by arya_starc
Akatsukami wrote:And where is the value of filei supposed to be coming from?


I am passing thru the jcl in the dd name

Re: CallinG REXX thru JCL

PostPosted: Mon Feb 13, 2017 2:12 pm
by willy jensen
in that case you can use the LISTDSI function to get the dsname, i.e.:
cc=ListDsi('filei file')
filei="'"sysdsname"'"

refer to the REXX manual for details.

Re: CallinG REXX thru JCL

PostPosted: Tue Feb 14, 2017 6:39 pm
by arya_starc
Hi Willy,

I changed the previously coded rexx to below rexx, but still I am getting the same error by submitting the same JCL


****** ***************************** Top of Data ******************************
 000100 /*REXX*/                                                                
 000200 ADDRESS TSO                                                            
 000300  CC=LISTDSI('FILEI FILE')                                              
 000400  FILEI="'"SYSDSNAME"'"                                                  
 000700     "LISTDS" FILEI "MEMBERS"                                            
 002900 SAY "MEMBERS SUCCESSFULLY WRITE"                                        
 003000 EXIT                                                                    
 ****** **************************** Bottom of Data ****************************
 


JCL is same

//PAFKREX2 JOB (0000,REXX),'DEV11',CLASS=Y,MSGCLASS=A            
//STEP30 EXEC PGM=IKJEFT01,PARM='LISTDS'                        
//SYSEXEC DD DSN=TS.PAFK.SUSHIL.PDS,DISP=SHR                    
//FILEI   DD DSN=VM.LAT.D10A010.PF.JCLLIB.SASH,DISP=SHR          
//SYSPRINT DD SYSOUT=*                                          
//SYSTSPRT DD SYSOUT=*                                          
//SYSTSIN  DD DUMMY