How to pass input from Rexx to JCL



IBM's Command List programming language & Restructured Extended Executor

Re: How to pass input from Rexx to JCL

Postby Quasar » Tue Mar 26, 2013 10:39 pm

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.
Quasar Chunawala,
Software Engineer, Lives at Borivali, Mumbai
User avatar
Quasar
 
Posts: 102
Joined: Wed Nov 10, 2010 7:11 pm
Location: Borivali, Mumbai
Has thanked: 13 times
Been thanked: 2 times

Re: Re: How to pass input from Rexx to JCL

 

Re: How to pass input from Rexx to JCL

Postby Sonal C » Wed Mar 27, 2013 12:37 pm

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
Sonal C
 
Posts: 17
Joined: Wed Nov 07, 2012 12:20 pm
Has thanked: 0 time
Been thanked: 0 time

Re: How to pass input from Rexx to JCL

Postby Sonal C » Wed Mar 27, 2013 6:56 pm

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
Sonal C
 
Posts: 17
Joined: Wed Nov 07, 2012 12:20 pm
Has thanked: 0 time
Been thanked: 0 time

Re: How to pass input from Rexx to JCL

Postby Akatsukami » Wed Mar 27, 2013 7:28 pm

You are attempting to run this through the Rexx interpreter. Anything with a call to ISPEXEC in it must be run through background ISPF.
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1053
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Re: How to pass input from Rexx to JCL

Postby Sonal C » Wed Mar 27, 2013 7:48 pm

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
Sonal C
 
Posts: 17
Joined: Wed Nov 07, 2012 12:20 pm
Has thanked: 0 time
Been thanked: 0 time

Re: How to pass input from Rexx to JCL

Postby enrico-sorichetti » Wed Mar 27, 2013 7:57 pm

see my posts here
http://ibmmainframes.com/about57213.html
on how invoke ispf services in BATCH
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2643
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 130 times

Re: How to pass input from Rexx to JCL

Postby NicC » Wed Mar 27, 2013 9:31 pm

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
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2690
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 105 times

Re: How to pass input from Rexx to JCL

Postby Pedro » Wed Mar 27, 2013 11:57 pm

" 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.
Pedro Vera
User avatar
Pedro
 
Posts: 569
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 39 times

Re: How to pass input from Rexx to JCL

Postby Sonal C » Thu Mar 28, 2013 1:09 pm

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
Sonal C
 
Posts: 17
Joined: Wed Nov 07, 2012 12:20 pm
Has thanked: 0 time
Been thanked: 0 time

Re: How to pass input from Rexx to JCL

Postby enrico-sorichetti » Thu Mar 28, 2013 1:28 pm

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
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2643
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 130 times

PreviousNext

Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post