View previous topic :: View next topic
|
Author |
Message |
BlackSunday
New User
Joined: 05 Oct 2022 Posts: 3 Location: Spain
|
|
|
|
Hi there!!
I'm trying to evaluate a variable in order to execute one step in a jcl or another distinct step in the same jcl.
I've tried with IF/THEN/ELSE but with this method i can't evaluate variables, only RCs
I pass the variable through CONTROL-M and it can take two possibles values, PROG or DSN. And depending of these values i have to execute one step for PROG or another step for DSN
Any idea???
Thanks a lot!!!! |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2127 Location: USA
|
|
|
|
If you want to get a response, please, be polite to the members of this forum:
1) Learn how to use the Code button when posting messages
2) Present here your input data (using Code button)
3) Present here your own code (using Code button)
4) Present here your desired output (using Code button)
5) Present here your actual output data (using Code button)
6) Present here all and every error/warning message, and/or error code received.
If not, you can continue your postings as long as you wish. |
|
Back to top |
|
|
Willy Jensen
Active Member
Joined: 01 Sep 2015 Posts: 730 Location: Denmark
|
|
|
|
This small REXX might help:
Code: |
/* rexx
Set return code
the parm value if the parm is a number
else assume parm is a test, set rc:
0 if test is true
1 if test is false
multiple test can be combined
Samples expressions
$dmon=feb
$dyyyy=2012
$dyy=18
symbol(sysr1)
Sample job
//SETRC0 EXEC PGM=IKJEFT1B,PARM='SETRCX translate(date(W))=FRIDAY'
//SYSEXEC DD DISP=SHR,DSN=...
//SYSTSPRT DD DUMMY
//SYSTSIN DD DUMMY
*/
if datatype(arg(1))='NUM' then return arg(1)
/* set internal variables */
parse value time() with $th':'$tm':'$ts
$dmon = translate(word(date(),2)) /* month name i.e. FEB */
$day = translate(left(date('w'),3)) /* day of week, i.e. TUE */
parse value date('s') with $ymd 0 $dyyyy +4 $dmm +2 $ddd 0 . +2 $dyy +2 .
$dmy = $ddd''$dmm''$dyy
$ymd = $dyy''$dmm''$ddd
$jesnode = sysvar('sysnode')
$sysname = mvsvar('sysname')
$sysplex = mvsvar('sysplex')
$jobname = mvsvar('symdef','jobname')
signal on syntax
signal on error
Interpret "cc=("arg(1)")"
return cc=0
Syntax:
Error:
return 99
/* speciel builtin functions */
Symbol: return mvsvar('symdef',arg(1)) |
|
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3076 Location: NYC,USA
|
|
|
|
You can use DFSORT using JPn to set RC based on what values you get and use IFTHEN LATER. |
|
Back to top |
|
|
|