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

Input from JCL to REXX


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

Active User


Joined: 02 May 2005
Posts: 128
Location: UK

PostPosted: Tue Jun 09, 2009 1:17 pm
Reply with quote

Hello All ,

I have one requirement to pass a value to REXX from JCL . I don't know if symbolic parameter works in REXX.

In my JCL i am executing a REXX . where i need to pass a value from JCL .

Can any one please tell me who to use symbolic parameters in JCL .

Thanks In advance
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Jun 09, 2009 1:33 pm
Reply with quote

Please do not start a new thread on the back of an existing one.

Have you searched the forum, because this topic has been discussed numerous times recently.
Back to top
View user's profile Send private message
genesis786

Active User


Joined: 28 Sep 2005
Posts: 210
Location: St Katherine's Dock London

PostPosted: Tue Jun 09, 2009 1:43 pm
Reply with quote

one way could be:

first few lines of your rexx are like:

Code:

/* rexx called MYREXX*/

parse arg parm1 parm2 parm3 ....



and jcl looks like:

Code:

//STEP1 EXEC PGM=IKJEFT01
//SYSEXEC DD DSN=xx.xx.xx
//..
//SYSIN DD *
   %MYREXX PARM1 PARM2 PARM3 ....
/*
Back to top
View user's profile Send private message
shr_amar
Warnings : 2

Active User


Joined: 02 May 2005
Posts: 128
Location: UK

PostPosted: Tue Jun 09, 2009 2:09 pm
Reply with quote

Yes i have tried to search the forum . But it does not talk about symbolic.

I want to use symbolic parameter like

Date=*****
TIME=*****

And this value ****** i need to get in to the REXX.

This will help user to understand what parameter we are passing
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Jun 09, 2009 2:19 pm
Reply with quote

Is it a set date / time or the current date / time ?
Back to top
View user's profile Send private message
genesis786

Active User


Joined: 28 Sep 2005
Posts: 210
Location: St Katherine's Dock London

PostPosted: Tue Jun 09, 2009 2:22 pm
Reply with quote

why would you want to pass current date and time from JCL when you can use DATE() and TIME() functions in rexx ? any specific requirement?
Back to top
View user's profile Send private message
shr_amar
Warnings : 2

Active User


Joined: 02 May 2005
Posts: 128
Location: UK

PostPosted: Tue Jun 09, 2009 2:26 pm
Reply with quote

well this is not a date i have just given example . It may be name
NAME=*****.
Back to top
View user's profile Send private message
genesis786

Active User


Joined: 28 Sep 2005
Posts: 210
Location: St Katherine's Dock London

PostPosted: Tue Jun 09, 2009 2:29 pm
Reply with quote

how are you running rexx from the jcl ? can you paste something here ? does above example not suit your purpose ?
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Jun 09, 2009 2:46 pm
Reply with quote

shr_amar wrote:
well this is not a date i have just given example . It may be name
NAME=*****.

Well, perhaps if you talked about the actual requirement rather than a hypothetical requirement the responses given would be
(a) Helpfull
(b) Not wasting bandwidth on the forum
Back to top
View user's profile Send private message
shr_amar
Warnings : 2

Active User


Joined: 02 May 2005
Posts: 128
Location: UK

PostPosted: Tue Jun 09, 2009 3:12 pm
Reply with quote

I AM EXECUTING A JCL WHICH CALL A REXX PROGRAM TO SUBMIT MULTIPLE JOBS BASED ON THE RETURN CODE.

PGM=IKJEFT1B,DYNAMNBR=30,PARM=TRAMREGT

TRAMREGT IS THE REXX PROGRAM .

THE REQUIREMENT IS VERY SIMPLE AS WE USE TO PASS SYMBOLIC PARAMETER FROM JCL TO PROC , I WANT IT TO PASS FROM JCL TO REXX

E.G

JOB1 ==> MAIN JOB WHICH EXECUTE REXX PROGRAM TO SUBMIT OTHER JOB'S (JOB2,JOB3)
JOB2==> IS THE JOB WHICH HAVE SOME SYMBOLIC PARAMETER DEFINED .
I WANT TO PASS THIS PARAMETER FROM JOB1==>REXX==> JOB2.

I HOPE I AM CLEAR .
LET ME KNOW IF YOU ARE LOOKING FOR MORE INFO
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Tue Jun 09, 2009 3:22 pm
Reply with quote

Don't shout!

Are you building your own job scheduler???
Back to top
View user's profile Send private message
shr_amar
Warnings : 2

Active User


Joined: 02 May 2005
Posts: 128
Location: UK

PostPosted: Tue Jun 09, 2009 3:39 pm
Reply with quote

Its nothing related to job scheduler . Its just passing data from JCl to REXX using symbolic parameter
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Tue Jun 09, 2009 3:48 pm
Reply with quote

shr_amar wrote:
I AM EXECUTING A JCL WHICH CALL A REXX PROGRAM TO SUBMIT MULTIPLE JOBS BASED ON THE RETURN CODE.


In other words, jour own little job-scheduler.

There are real products around that do this job!
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Jun 09, 2009 3:52 pm
Reply with quote

Quote:
I AM EXECUTING A JCL WHICH CALL A REXX PROGRAM TO SUBMIT MULTIPLE JOBS BASED ON THE RETURN CODE.


The return code of what ?
Back to top
View user's profile Send private message
shr_amar
Warnings : 2

Active User


Joined: 02 May 2005
Posts: 128
Location: UK

PostPosted: Tue Jun 09, 2009 4:00 pm
Reply with quote

Return code of JOB2.

But the requirement is not to make schedular .
I will try to make things more clear

E.g in my rexx i am using a variable "Var1" i want to pass value to this variable from JCL like

//REXXINS EXEC PGM=IKJEFT1B,DYNAMNBR=30,PARM=REXX
// Var1=XYZ

so when rexx is executed VAR1 should have XYZ in it
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Tue Jun 09, 2009 4:12 pm
Reply with quote

shr_amar wrote:
Return code of JOB2.


In other words, your own little job-scheduler! SIASD!
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Jun 09, 2009 4:17 pm
Reply with quote

And how do you propose to collect the return code of an external job ?
Back to top
View user's profile Send private message
shr_amar
Warnings : 2

Active User


Joined: 02 May 2005
Posts: 128
Location: UK

PostPosted: Tue Jun 09, 2009 4:25 pm
Reply with quote

Hey Guys ,

Requirement is not to make schedular .
I will try to make things more clear

E.g in my rexx i am using a variable "Var1" i want to pass value to this variable from JCL like

//REXXINS EXEC PGM=IKJEFT1B,DYNAMNBR=30,PARM=REXX
// Var1=XYZ

so when rexx is executed VAR1 should have XYZ in it
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue Jun 09, 2009 4:34 pm
Reply with quote

maybe we inferred wrong, but it was You who had specified "BASED ON THE RETURN CODE"

anyway as a general point

Code:

//procnm  PROC
//IKJ     EXEC PGM=IKJEFT01,PARM='rexxnm &PARM1 &PARM2'
//...
//        PEND
//*
//g       EXEC procnm,PARM1=aaaaaa,PARM2=bbbbbb

is equivalent to
Code:

//IKJ     EXEC PGM=IKJEFT01
//SYSTSIN   DD *
  rexxnm aaaaaa bbbbbb
//...
Back to top
View user's profile Send private message
genesis786

Active User


Joined: 28 Sep 2005
Posts: 210
Location: St Katherine's Dock London

PostPosted: Tue Jun 09, 2009 5:27 pm
Reply with quote

not related to this perhaps but in our shop.. some creative person developed a mini sequential scheduler using rexx. idea was something like this:

1. All the Jobs kept at one PDS

2. A dummy JCL step was built (a kind of skeleton), which would be appended to all the Jobs at the end.

3. A member in that PDS had the sequence of jobs to be run.

4. A Rexx routine which will read this schedule member and append the dummy step (#2) at the end of jcl and then submit it.

5. A dummy job to start the whole process.

icon_smile.gif not very elegant but saved a lot of time. since operations couldn't provide us a CA7 scheduler for Dev region, we used this instead.
Back to top
View user's profile Send private message
shr_amar
Warnings : 2

Active User


Joined: 02 May 2005
Posts: 128
Location: UK

PostPosted: Fri Jun 12, 2009 12:02 pm
Reply with quote

Thanks enrico,

This is working while passing data.But now i am facing one problem that while passing lowercase data it is failing as JCL error .

IEFC620I UNIDENTIFIABLE CHARACTER r ON THE EXEC STATEMENT

Code is like this
//WHRESET PROC
//REXXINS EXEC PGM=IKJEFT1B,DYNAMNBR=30,
// PARM='WAREREST &VER &WHN'

JCL

//REXX0SE EXEC WHRESET,
// VER=AS1,
// WHN=trm

if i pass WHN=TRM job executed sucessfully but with lowercase it is failing .
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Fri Jun 12, 2009 12:11 pm
Reply with quote

Lowercase is invalid in JCL
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Fri Jun 12, 2009 4:56 pm
Reply with quote

I am not sure, but you might try enclosing in quotes:
Code:
//REXX0SE EXEC WHRESET,
// VER=AS1,
// WHN='trm'


You did not say what &WHN will be used for, but if it will also be JCL, then you will still get an error.

Why does it have to be in mixed case?
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 TRIM everything from input, output co... DFSORT/ICETOOL 1
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 Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top