Page 1 of 2

How to pass DSNs name to JCL

PostPosted: Mon Jan 02, 2012 11:05 pm
by zhinghur
Hi everyone,

I am very new to REX. I have one requirement. I have to trigger a JCL using REX.

When executed, it should first asked for
"Please Enter the input file"
After inputting the file name it should ask for output file,
"please enter output file"

Also, how to code so that it can be sent to my JCL particular step, these two DSN name..

Thank You

Re: How to pass DSNs name to JCL

PostPosted: Mon Jan 02, 2012 11:18 pm
by MrSpock
It depends. Where does your JCL come from, and how does your process expect these values to be passed?

Re: How to pass DSNs name to JCL

PostPosted: Tue Jan 03, 2012 1:28 am
by zhinghur
JCL doesn't come from anywhere. When he rex program is executed, it will trigger the JCL.

Now I want to pass Input and Outfile file name during execution to this JCL.

Re: How to pass DSNs name to JCL

PostPosted: Tue Jan 03, 2012 4:53 am
by steve-myers
zhinghur wrote:... JCL doesn't come from anywhere. ...

JCL always comes from somewhere. I'm sure there are methods for your Rexx exec to create a small JCL job that contains a JOB statement and an EXEC statement containing symbols with your dataset names that calls a JCL procedure that does the heavy lifting. The created job would look something like this -
//MYJOB    JOB ...
//MYJCL JCLLIB ORDER=(my PROCLIB)
//MYEXEC  EXEC MYPROC,
//  INDSN='input dataset name',
//  OUTDSN='output dataset name'

MYPROC in your PROBLIB would look something like this -
//MYPROC  PROC INDSN='?',OUTDSN='?'
//MYSTEP  EXEC PGM=...
//INPUT    DD  DISP=OLD,DSN=&INDSN
//OUTPUT   DD  DISP=(NEW,CATLG),DSN=&OUTDSN,...

Obviously the MYPROC procedure would be more complex, but that's beyond the scope of this topic.

There are other ways to do this. For example, I suspect the major job scheduling packages should be able to create and submit the job without you writing a line of Rexx code. This method would be required in virtually all production shops, and this is where your research should lead you, not trying to reinvent a most likely deformed wheel.

Re: How to pass DSNs name to JCL

PostPosted: Tue Jan 03, 2012 6:16 am
by Robert Sample
When he rex program is executed, it will trigger the JCL.
Complete and utter garbage. The JCL was generated by the REXX (not rex) program, or the JCL was read from a data set, or the JCL came from some other source -- but JCL does not magically get "triggered" out of thin air. And what do you mean by "trigger" anyway -- created? submitted? executed? converted and interpreted? something else?

Re: How to pass DSNs name to JCL

PostPosted: Tue Jan 03, 2012 3:23 pm
by zhinghur
Sorry, actually I divided the part of requirement. So, couldn't be specific.

Please find my 7th and 8th posts here, which will give the clear pleasure.

Re: How to pass DSNs name to JCL

PostPosted: Tue Jan 03, 2012 7:44 pm
by enrico-sorichetti
which will give the clear pleasure.


unfortunately most of the people hanging around here prefer different kinds of pleasure ...
( usually very dark ) :geek:

Re: How to pass DSNs name to JCL

PostPosted: Tue Jan 03, 2012 9:51 pm
by Akatsukami
enrico-sorichetti wrote:
which will give the clear pleasure.


unfortunately most of the people hanging around here prefer different kinds of pleasure ...
( usually very dark ) :geek:

Now, now. Give me a glass of bourbon, a cigar, and a scantily-clad redhead and I'm perfectly content :mrgreen:

Re: How to pass DSNs name to JCL

PostPosted: Wed Jan 04, 2012 1:47 am
by enrico-sorichetti
Konnichwa Akatsukami Sama !

the unfortunately refers to the TS concept of pleasure,
not certainly our ;)

Re: How to pass DSNs name to JCL

PostPosted: Wed Jan 04, 2012 1:54 am
by dick scherrer
Hello,

Sorry, actually I divided the part of requirement. So, couldn't be specific.
What . . . :?
If you cannot be specific, how can anyone help. Indeed, how can you even think about implementing. . .
If you will take the time to explain what you really want others here have done the same or very similar, but what you have provided gives a "helper" nothing. . .

Please find my 7th and 8th posts here, which will give the clear pleasure.
Where are we to find these 7th and 8th posts "here" - you don't have 8 posts in this topic that i can see (until now this topic only has 7 posts).