Page 2 of 4

Re: How to pass input from Rexx to JCL

PostPosted: Tue Mar 26, 2013 10:39 pm
by Quasar
Hi Sonal,

ISPF has a powerful feature called File-Tailoring, that allows you to create generic JCL streams, that can be configured on-the-fly, without destroying the original template. These templates are called skeletons and are stored in a skeleton-library (ISPSLIB).

This is what, your skeleton, let's call it MYSKEL would look like -

//JOBA JOB ,CLASS=B,MSGCLASS=A
//STEP01 EXEC PGM=IKJEFT01,DYNAMNBR=30
//SYSPRINT DD SYSOUT=*
//SYSEXEC DD DISP=SHR,DSN=MYREXX PDS
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD *
&name
/*
//


Using file tailoring is fairly simple. Do you know how parameters are substituted in JCL Procedures? This hardly requires any Rexx programming experience.

ADDRESS ISPEXEC
"FTOPEN TEMP"


FTOPEN starts the file-tailoring process. The TEMP option tells, that the output after having tailoredl and customized the skeleton, should be stored in a temporary dataset.

ADDRESS ISPEXEC
"FTINCL MYSKEL"


Next, the FTINCL MYSKEL command gets the MYSKEL skeleton file and processes it - scans each line of the skeleton, one-by-one and substitutes any variables.

ADDRESS ISPEXEC
"FTCLOSE"


An FTCLOSE finalizes this dataset. In ISPF, the name of the temporary output dataset is stored in a special variable(in the shared ISR Pool) called ZTEMPF. You can query this name by a VGET.

ADDRESS ISPEXEC
"VGET ZTEMPF SHARED"


You may choose to either edit the dataset or submit the file.

Re: How to pass input from Rexx to JCL

PostPosted: Wed Mar 27, 2013 12:37 pm
by Sonal C
Thank you all for your reply. I will try these codes and will definetly come up with code developed by myself.

Thanks again. I have already started reading manuals.

Regards,
Sonal

Re: How to pass input from Rexx to JCL

PostPosted: Wed Mar 27, 2013 6:56 pm
by Sonal C
Hi Enrico,

I did following tasks till now:
PANEL:
ATTR                                                       
   +   TYPE(TEXT)   INTENS(LOW)  SKIP(ON)                   
   ^   TYPE(TEXT)   INTENS(LOW)  SKIP(ON)                   
   %   TYPE(TEXT)   INTENS(LOW)  SKIP(ON)                   
   _   TYPE(INPUT)  INTENS(LOW)           PAD ('_')         
)BODY EXPAND(##)                                           
 % Please enter the module
 +                                                         
 % MODULE _MOD     +                                                                           
 +                                                         
 ^    PRESS 'ENTER' to continue         PRESS 'PF3' to EXIT
)INIT               
   .CURSOR = MOD   
)PROC               
 VER (&MOD,NB)           
)END         


REXX:

/*REXX*/                                                               
/* Display the panel. If user presses F3, leave.                      */
DIS_PANEL:                                                             
 "ISPEXEC DISPLAY PANEL(SYSREF1)"                                       
PARSE ARG MOD                                                                                                           
REF_JCL:                                                               
   ADDRESS TSO                                                         
  "ISPEXEC FTOPEN TEMP"                                                 
  "ISPEXEC FTINCL REFJCL"                                               
  " SUBMIT 'SLIB FILE(SYS1JCL)'"                                 
  "ISPEXEC FTCLOSE" 

SYS1JCL:
//JOB123 JOB D00000000000,'SAMPLE JCL TO RUN   ',CLASS=B,       
 // NOTIFY=&SYSUID,MSGCLASS=A                                                                               
 //STEP01 EXEC PGM=IRXJCL,PARM='REFREX'                           
 //SYSEXEC DD DSN=ABCD.CLIB,DISP=SHR                       
 //SYSTSIN DD *                                                   
 //SYSOUT DD SYSOUT=*                                             
 //SYSPRINT DD SYSOUT=*                                           
 //SYSTSPRT DD SYSOUT=*                                           
 /*   

When I am running this I am getting below error message:

9 *-* "ISPEXEC FTOPEN TEMP"                 
   +++ RC(-3) +++                           
10 *-* "ISPEXEC FTINCL REFJCL"               
   +++ RC(-3) +++                           
11 *-* " SUBMIT 'ABCD.SLIB(SYS1JCL)'"
   +++ RC(-3) +++                           
12 *-* "ISPEXEC FTCLOSE"                     
   +++ RC(-3) +++ 

Can you please help me in getting out of this error.

Thanks,
Sonal

Re: How to pass input from Rexx to JCL

PostPosted: Wed Mar 27, 2013 7:28 pm
by Akatsukami
You are attempting to run this through the Rexx interpreter. Anything with a call to ISPEXEC in it must be run through background ISPF.

Re: How to pass input from Rexx to JCL

PostPosted: Wed Mar 27, 2013 7:48 pm
by Sonal C
Can you please let me know what is BACKGROUND ISPF? I searched for the return code RC(-3) in google and found as its due to unknown command. I guess its not allowing me to use ISPEXEC. Could you please let me know what i can use in alternative of that.

As i have already given my requirements. I am creating a REXX which will call JCL. So I used ISPEXEC.

Let me know where i am doing mistake.

Regards,
Sonal

Re: How to pass input from Rexx to JCL

PostPosted: Wed Mar 27, 2013 7:57 pm
by enrico-sorichetti
see my posts here
http://ibmmainframes.com/about57213.html
on how invoke ispf services in BATCH

Re: How to pass input from Rexx to JCL

PostPosted: Wed Mar 27, 2013 9:31 pm
by NicC
Sonal, please use the code tags for stuff you see on your terminal. I will code up your last post. Search the forum for "code tags" to find out how to use them. Hint - use POSTRELPY not "Quick Reply" button

Re: How to pass input from Rexx to JCL

PostPosted: Wed Mar 27, 2013 11:57 pm
by Pedro
" SUBMIT 'SLIB FILE(SYS1JCL)'"

Your SUBMIT command does not look correct. The file tailoring results will be placed in the ISPFILE dd name (I do not see that mentioned in example mentioned in this thread). Typically, the ISPFILE dd name is allocated to a temporary dataset; you get the name through the use of variable ZTEMPF.

Sonal, you did not explain where you executing your REXX program. Please be as specific as you can. Because you are getting the -3, likely you are executing it outside of ISPF. You cannot use ISPF services when you are not in ISPF. You did not show it, but I would expect the DISPLAY to fail first.

Re: How to pass input from Rexx to JCL

PostPosted: Thu Mar 28, 2013 1:09 pm
by Sonal C
Thank you all again for helping me in this.

Enrico Sir,

I tried the link given by you and it helped in coming out of RC(-3) error. But again I am facing error. MAXCC =990
When i searched in google its showing due to 330 BDISPMAX exceeded. But in SPOOL i am geting different error.

Please have a look:

ISPP100 Panel 'REF1' error   -/-Panel not found


I used trace option and found below:
6 *-* REF_JCL:                                   
     7 *-* ADDRESS TSO                               
     8 *-* "ISPEXEC FTOPEN TEMP"                     
       >L>   "ISPEXEC FTOPEN TEMP"                   
     9 *-* "ISPEXEC FTINCL REFJCL"                   
       >L>   "ISPEXEC FTINCL REFJCL"                                                   
    10 *-* " SUBMIT 'ISS.#SPF.USRSLIB(REFJCL)'"     
       >L>   " SUBMIT 'ISS.#SPF.USRSLIB(REFJCL)'"   
JOB JOBABC(JOB20698) SUBMITTED                     
    11 *-* "ISPEXEC FTCLOSE"                         
       >L>   "ISPEXEC FTCLOSE" 


It will be very helpful if you will correct me.

Currenlty I am not doing any functionality in REFJCL. Once this gets resolved I will be editing it according to my assignment.

I just want to display the inputs which i am passing through panel ( already posted) to the JCL SPOOLER.

Regards,
Sonal

Re: How to pass input from Rexx to JCL

PostPosted: Thu Mar 28, 2013 1:28 pm
by enrico-sorichetti
unfortunately You cannot have that ...
wiser not to attempt to display a panel in batch

for a BATCH solution the proper approach would be along the lines of

ISPSTART CMD(<your command> <your command parms>)


inside Your command use

PARSE ARGS par1 par2 par3


and get rid of the PANEL stuff