Hello,
in my jobcard, there is : COND=(4,LT)
So my job ended in error if a step is equal or higher the RC = 4
if my DATASET.A have at least a record, the execute :
STEP1A
STEP2A
STEP3A
if my DATASET.B have at least a record, the execute :
STEP1B
STEP2B
STEP3B
is it possible without using IF THEN ELSE ?
Empty dataset and step execution
- prino
- Posts: 641
- Joined: Wed Mar 11, 2009 12:22 am
- Skillset: PL/I - CICS - DB2 - IDMS - REXX - JCL, most in excess of three decades
- Referer: Google
- Location: Vilnius, Lithuania
- Contact:
Re: Empty dataset and step execution
samb01 wrote:in my jobcard, there is : COND=(4,LT)
So my job ended in error if a step is equal or higher the RC = 4
And why is that an error? A job can end with RC=4095 and still be OK!
[quote="samb01"]
if my DATASET.A have at least a record, the execute :
STEP1A
STEP2A
STEP3A
if my DATASET.B have at least a record, the execute :
STEP1B
STEP2B
STEP3B
is it possible without using IF THEN ELSE ?
IF-THEN-ELSE logic cannot look at the contents of datasets. In other words, the answer is NO!
Robert AH Prins
robert.ah.prins @ the.17+Gb.Google thingy
robert.ah.prins @ the.17+Gb.Google thingy
-
- Posts: 474
- Joined: Thu Mar 10, 2016 5:03 pm
- Skillset: assembler rexx zOS ispf racf smf
- Referer: saw it in the experts foprum thought I could help here
Re: Empty dataset and step execution
I assuming that you intend to use something like ICETOOL .. COUNT to set a return code of an early step. As you want to control running of steps, then the job statement COND is not the way to go, you must use the IF/THEN/ELSE/ENDIF statement constructs between steps.
Re: Empty dataset and step execution
But i can test if the dataset is empty (at least on record) or not empty ?
-
- Posts: 474
- Joined: Thu Mar 10, 2016 5:03 pm
- Skillset: assembler rexx zOS ispf racf smf
- Referer: saw it in the experts foprum thought I could help here
Re: Empty dataset and step execution
Certainly:
But that wasn't your question, as I understood the subject.
Code: Select all
//* COUNT .. EMPTY|NOTEMPTY -> RC 12 IF CONDITION IS MET
//C1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//DD1 DD DISP=SHR,DSN=dataset.name
//TOOLIN DD *
COUNT FROM(DD1) EMPTY
But that wasn't your question, as I understood the subject.
Re: Empty dataset and step execution
Hello willy jensen.
You're right, i want to control running of steps, then the job statement COND.
But i can't anderstand why it is not the right way to do.
With IF THEN ELSE, it might have probleme with rerun the job wich abended. I thought it easier to resstart the job with Code Condition...
You're right, i want to control running of steps, then the job statement COND.
But i can't anderstand why it is not the right way to do.
With IF THEN ELSE, it might have probleme with rerun the job wich abended. I thought it easier to resstart the job with Code Condition...
-
- Posts: 474
- Joined: Thu Mar 10, 2016 5:03 pm
- Skillset: assembler rexx zOS ispf racf smf
- Referer: saw it in the experts foprum thought I could help here
Re: Empty dataset and step execution
Because the JOBCOND applies to all steps in a job, except the first. Or in other words, depending on the cc of the first step then either all or none of the following steps will be executed, depending on cc from the exected steps.
You can choose between the step COND statement or the IF/THEN/ELSE construct, I will definitely recommand the latter.
You can choose between the step COND statement or the IF/THEN/ELSE construct, I will definitely recommand the latter.
-
- Global moderator
- Posts: 3025
- Joined: Sun Jul 04, 2010 12:13 am
- Skillset: JCL, PL/1, Rexx, Utilities and to a lesser extent (i.e. I have programmed using them) COBOL,DB2,IMS
- Referer: Google
- Location: Pushing up the daisies (almost)
Re: Empty dataset and step execution
If this is a job controlled by a scheduler then you stop the job after discerning that the data set is empty or not. Then the scheduler will submit the 'A' job or the 'B' job depending on the return code from this job.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
Regards
Nic
Re: Empty dataset and step execution
samb01 wrote:Hello,
in my jobcard, there is : COND=(4,LT)
So my job ended in error if a step is equal or higher the RC = 4
I would say that if the RC issued was 4, which is NOT less than 4 then the condition would not be met.
perhaps using 4,LE would be better.
Re: Empty dataset and step execution
Hello expat, you are right !!! Thank's for your vigilance 

-
- Similar Topics
- Replies
- Views
- Last post
-
- 0
- 1554
-
by prisgs
View the latest post
Fri Nov 18, 2022 8:30 pm
-
- 10
- 3681
-
by willy jensen
View the latest post
Tue Oct 31, 2023 8:36 pm
-
- 9
- 2890
-
by sergeyken
View the latest post
Thu Jan 09, 2025 11:59 pm
-
-
Sending o/p file's content to spool withot adding extra step
by Misha786 » Tue Jan 12, 2021 6:51 pm » in JCL - 4
- 2029
-
by sergeyken
View the latest post
Tue Jan 12, 2021 11:28 pm
-
-
- 12
- 3913
-
by RalphEagle
View the latest post
Fri Jul 30, 2021 1:00 pm