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

How to give complex condition in JCL .


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

Active User


Joined: 20 Apr 2022
Posts: 148
Location: India

PostPosted: Wed May 04, 2022 2:35 pm
Reply with quote

Code:
[code]//S0      EXEC PGM=IEBGENER                 
//SYSPRINT DD SYSOUT=*                       
//SYSIN    DD DUMMY                         
//SYSUT2   DD DISP=SHR,DSN=statds           
//SYSUT1   DD *                             
INIT                                         
//*                                         
//ENBP1000 EXEC PGM=whatever
//*                                         
//        IF ENBP1000.RC = 0 THEN           
//S1      EXEC PGM=IEBGENER                 
//SYSPRINT DD SYSOUT=*                       
//SYSIN    DD DUMMY                         
//SYSUT2   DD DISP=SHR,DSN=statds           
//SYSUT1   DD *                             
OK                                           
//        ELSE                               
//S2      EXEC PGM=IEBGENER                 
//SYSPRINT DD SYSOUT=*                       
//SYSIN    DD DUMMY                         
//SYSUT2   DD DISP=SHR,DSN=statds           
//SYSUT1   DD *                             
FAIL                                         
//        ENDIF                             
//*                       [code][/code][/code]


I found this approach better , anyone has any suggestion not tried yet but would like to go with this approach which i also had since i started thinking to resolve this proble.

Thanks WJ

Thank you all for help , good discussion learnt few things from here.
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2141
Location: USA

PostPosted: Wed May 04, 2022 4:44 pm
Reply with quote

It's up to you, but you continuously ignore all advices to eliminate your senseless approach to run two asynchronous processes for simple sequential operations.

All your efforts are required only to provide synchronization (a stupid one) between your parallel processes.

As you were told several times, you cannot predict the actual behavior of your first submitted job; it could not start at all (for 100 reasons), it can be cancelled by administration, it can fail in the middle (for 1,000,000 different reasons). In any of those cases your "job scheduling" REXX code is doomed to wait forever...

The main issue is: this is absolutely unneeded activity for your extremely simple and primitive original task.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3076
Location: NYC,USA

PostPosted: Thu May 05, 2022 6:43 am
Reply with quote

One easy way to fix this is to move step 2 from main job into that random submitted job as a last step in it and there you could check RC if the previous step ( previous step of that random job) to control this step2s execution.

Topic will be locked soon ..
Back to top
View user's profile Send private message
Digvijay Singh

Active User


Joined: 20 Apr 2022
Posts: 148
Location: India

PostPosted: Thu May 05, 2022 11:16 am
Reply with quote

Thanks all,

only thing i wanted to avoid lot of changes in rexx which is submitting the internal job and there are amy conditon on which a final jcl card has been prepared (internal job), thats why its bit difficult.

I have also this approach to change the random job name to a constant and captue the log of this job from Savers and all using $averpull utility and all.

I will capture the log(RC of job ) in a file and accordingly i will execute the 2nd step of my main job.

you may think i am stupid but just had this idea so i shared.
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Thu May 05, 2022 10:45 pm
Reply with quote

note: I do not know anything about Savers.

Quote:
change the random job name to a constant and capture the log of this job from Savers

But it is your rexx that creates the job name. After creating the job name, just save the name to a file so that, knowing the job name, you can use Savers to retrieve the output.

Earlier, I had asked how you submitted the job. You did not answer. But my suggestion was to use OUTTRAP to capture the message returned from a SUBMIT command. I think it will have the job number, which I think you might also use to retrieve output.
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Thu May 05, 2022 10:46 pm
Reply with quote

Quote:
you may think i am stupid


You are not stupid... just inexperienced, which is why you are asking questions here. But it is not clear why you refuse the best advice.
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 Goto page Previous  1, 2

 


Similar Topics
Topic Forum Replies
No new posts Add condition to a FINDREP SORT card DFSORT/ICETOOL 4
No new posts Concatenate 2 input datasets and give... JCL & VSAM 2
No new posts To Omit records based n SORT condition DFSORT/ICETOOL 6
No new posts Using Multiple IFTHEN and WHEN condit... SYNCSORT 12
No new posts Save SYSLOG in a MASS complex All Other Mainframe Topics 3
Search our Forums:

Back to Top