IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Invoking REXX thru JCL


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Govarthanan

New User


Joined: 22 Nov 2013
Posts: 10
Location: India

PostPosted: Tue Jan 07, 2014 7:27 pm
Reply with quote

Hello All,

I am facing a problem with a tool I am developing. Please let me know if there are any other ideas or ways to solve this.

I have a an ISPF program that submits a skeleton JCL which runs a REXX program at the back end.

1. The ISPF prog is as below
Code:

ADDRESS ISPEXEC
"LIBDEF ISPSLIB DATASET ID('MY DATASET')"
"FTOPEN TEMP"
"FTINCL CALLREXX"
"FTCLOSE"
"VGET ZTEMPF"
ADDRESS TSO
"SUBMIT '"ZTEMPF"'"


2. and the JCL is as below
Code:

//JOBLIB  DD DSN=DB85.DSNEXIT,DISP=SHR
//        DD DSN=DB85.DSNLOAD,DISP=SHR
//        DD DISP=SHR,DSN=MVSP.MIGRATON.SFSYLOAD
//*
//STEP1  EXEC PGM=IKJEFT01,PARM='%PROG1 &PARM1,&PARM2,&PARM3'
//SYSEXEC  DD DSN=MYREXX.TO.BE.CALLED,DISP=SHR
//SYSTSPRT DD  SYSOUT=*
//SYSTSIN  DD  DUMMY


And now since my parm1, parm2 and parm3 are too big, i get the following error
Code:

* ISPF105                                                                                            *
*                                                                                                   *
* Output overflow                                                                                    *
* Line to be written greater than data set LRECL (80), CALLREXX record-8                             *
* File tailoring input line:                                                                          *
//STEP1  EXEC PGM=IKJEFT01,PARM='%PROG1 &PARM1,&PARM2,&PARM3'



So till this it is an expected error, are there any other ways to make the prog run at back end.

The reason I had to go with this approach was bcoz the REXX program runs for a longer time, so i thought of making it to run in BATCH mode. But again am facing a dead end here.

Please do let me know if there are some other ways, that I should explore. icon_neutral.gif
Let me know in case of any concerns or queries.

Regards,
Govarthanan.K
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Tue Jan 07, 2014 7:50 pm
Reply with quote

Put the parameters in a file and change the rexx program to read the file.
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Tue Jan 07, 2014 8:39 pm
Reply with quote

As Sr. Vera suggests, you can place the parameters in a data set (or in-stream; ISPF file tailoring will work with in-stream variables). You can also break up your EXEC statement, thus:
Code:
//STEP1  EXEC PGM=IKJEFT01,
//           PARM='%PROG1 &PARM1,
//           &PARM2,
//           &PARM3'
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Tue Jan 07, 2014 10:30 pm
Reply with quote

Quote:
As Sr. Vera suggests, you can place the parameters in a data set


Actually, I said 'file' rather than data set. What I meant was to put the variables in-stream as you suggest. The file tailoring skeleton can be used to provide the in-stream records:

Code:
//JOBLIB  DD DSN=DB85.DSNEXIT,DISP=SHR
//        DD DSN=DB85.DSNLOAD,DISP=SHR
//        DD DISP=SHR,DSN=MVSP.MIGRATON.SFSYLOAD
//*
//STEP1  EXEC PGM=IKJEFT01,PARM='%PROG1'
//SYSEXEC  DD DSN=MYREXX.TO.BE.CALLED,DISP=SHR
//SYSTSPRT DD  SYSOUT=*
//SYSTSIN  DD  DUMMY
//MYDATA DD *
 &PARM1
 &PARM2
 &PARM3
/*
Back to top
View user's profile Send private message
sureshpathi10

Active User


Joined: 03 May 2010
Posts: 154
Location: Kuala Lumpur

PostPosted: Wed Jan 08, 2014 8:19 am
Reply with quote

Mr Pedro,

For me &PARM1, &PARM2, and &PARM3 looks like symbolic parameters.
I doubt that, we can use symbolic parameters within in-stream data. I may be wrong. Could you straighten me up?

My apologies, if this looks silly. But I really need to clarify for my future references.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Wed Jan 08, 2014 2:42 pm
Reply with quote

Presumably your file tailoring is replacing &PARMx so these will actually be data values within the instream data.
Back to top
View user's profile Send private message
Govarthanan

New User


Joined: 22 Nov 2013
Posts: 10
Location: India

PostPosted: Thu Jan 09, 2014 7:14 pm
Reply with quote

Thank you Pedro and Akatsukami, but i am sincerely sorry for my silly mistake.
One thing I dint mention earlier was, the parameters are basically queries so they tend to go beyond more than 100 characters, which is a limit in JCL.

So one way is to write in a file and read it in my REXX, is there any other way. Despite my search i found these 2 links nearly suiting my approach.

pic.dhe.ibm.com/infocenter/zos/v1r12/index.jsp?topic=%2Fcom.ibm.zos.r12.ikjc300%2Fikj4c310107.htm
and

stackoverflow.com/questions/1960784/how-to-pass-arguments-to-rexx-program-through-jcl


So what I tried was like below
Code:

//SYSTSIN  DD  *
 %ALPHA1
 SELECT COL1 FROM TABLE WHERE COL3=? AND COL4 = ?   -
 SELECT CL7 FROM TABLE1 WHERE COL2 = ? AND COL3 = ?  -
 
/*


The program is being invoked, but the parameters are not being substituted.
My doubt is how do we read the input into REXX, is it like reading a file or jus with keyword ARG, bcoz i tried both, and they dint work.

Please let me know if I am not clear, I can explain a bit more clear. Thanks in advance
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 792
Location: Pennsylvania

PostPosted: Thu Jan 09, 2014 8:49 pm
Reply with quote

I think as though you need a dash after %ALPHA1

Like this:

Code:
//SYSTSIN  DD  *
 %ALPHA1 -
 SELECT COL1 FROM TABLE WHERE COL3=? AND COL4 = ?   -
 SELECT CL7 FROM TABLE1 WHERE COL2 = ? AND COL3 = ?  -
 
/*
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 792
Location: Pennsylvania

PostPosted: Thu Jan 09, 2014 9:01 pm
Reply with quote

One more thing....

I understand English may not be your language, so words like 'bcoz' and 'dint' are not a part of it.

Try using the actual words instead.
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Fri Jan 10, 2014 2:50 am
Reply with quote

Oh, "dint" is an English word; it means an indentation, as in "My blow put a large dint in the software engineer's head" icon_evil.gif
Back to top
View user's profile Send private message
Mickeydusaor

Active User


Joined: 24 May 2006
Posts: 258
Location: Salem, Oregon

PostPosted: Fri Jan 10, 2014 4:14 am
Reply with quote

Middle English, short for indenten to make dents in, indent
First Known Use: 14th century
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Jan 10, 2014 5:19 am
Reply with quote

By dint of a search engine, another meaning was lost.
Back to top
View user's profile Send private message
Govarthanan

New User


Joined: 22 Nov 2013
Posts: 10
Location: India

PostPosted: Fri Jan 10, 2014 6:58 pm
Reply with quote

My sincere apologies Dave, for my English. I promise not to repeat them again.
Thanks for your hyphen (dash) also at the end of line 1, the program read the first parameter, but i am not able to differentiate subsequent parameters. I tried separating parameters with comma , is there something that I am missing
Code:

//SYSTSIN  DD  *
 %ALPHA1 -
 SELECT COL1 FROM TABLE WHERE COL3=? AND COL4 = ?   , -
 SELECT CL7 FROM TABLE1 WHERE COL2 = ? AND COL3 = ?    -
 
/*

but still parameter1 in my program reads both the query.
Thanks in advance icon_smile.gif
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 792
Location: Pennsylvania

PostPosted: Fri Jan 10, 2014 7:29 pm
Reply with quote

I think the issue is that you are trying to pass too much through an input argument.

While each line is a single parameter in YOUR MIND, the Rexx program (which you have not shown us, so I am using my crystal ball), sees PARM1 = SELECT, PARM2 = COL1, PARM3 = FROM etc

I have been coding Rexx since 1989, and I have never tried to pass this much data thru parameters.

If it were me, I would try the example Pedro shows above.
Your ALPHA1 program can use EXECIO to read MYDATA DD into PARM1, PARM2, PARM3.

You can continue to try your way, but better to take advice from those here. Isn't that why you posted in the first place?
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Fri Jan 10, 2014 10:31 pm
Reply with quote

Your example is too simple.

My experience with SELECT statements is that they can be quite large. You may want to write some that span many lines. For that reason, I think you need to read the statements from a file rather than as parameters to the exec. The normal delimiter for DB2 is a semicolon (';'). I think you want to read lines from a file until you find the semicolon and then concatenate all of the lines to create the single SELECT statement.

Then, read more lines until you find a semicolon, concatenate those, and so on ...

You may want to handle semicolons that occur within a quoted string... it should not be treated as a delimiter.
Back to top
View user's profile Send private message
Govarthanan

New User


Joined: 22 Nov 2013
Posts: 10
Location: India

PostPosted: Sat Jan 11, 2014 8:55 am
Reply with quote

Thanks Dave and Pedro.
I guess it s better I stick to the file format itself rather than passing.
I will try and let you know people. Thanks all
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
No new posts run rexx code with jcl CLIST & REXX 15
Search our Forums:

Back to Top