I understand but take a look at this

  Print indataset( empty filea)  
     If lastcc ne 0
          Print indataset(emptyfb) 
                If lastcc ne 0 then set maxcc = 8
             Else 
                Set maxcc = 0

If both files are empty the condition code should be 8
But I always get 0 from the IDCAMS step



Sent from my iPhone

> On Mar 5, 2014, at 7:28 PM, CM Poncelet <[email protected]> wrote:
> 
> But LASTCC applies only to the instruction that is being checked. As soon as 
> a new instruction is issued (or a higher level nested instruction completes), 
> LASTCC becomes the CC of this instruction.
> 
> E.g. Consider the following:
> 
> IF 1 EQ 1 DO
> SET LASTCC EQ 8
> END
> 
> The LASTCC following the above would be 0, because the IF-END completed with 
> CC = 0 (regardless of the SET LASTCC EQ 8 in-between).
> 
> So, change your LASTCC to MAXCC throughout - then check MAXCC instead of 
> LASTCC.
> 
> Micheal Butz wrote:
> 
>> I tried interrogating lastcc and setting
>> MAXCC still comes up with 0
>> 
>> Sent from my iPhone
>> 
>> 
>>> On Mar 5, 2014, at 6:37 PM, CM Poncelet <[email protected]> wrote:
>>> 
>>> Try setting MAXCC EQ <whatever, e.g. 4 or 8> instead of LASTCC.
>>> 
>>> Micheal Butz wrote:
>>> 
>>>   
>>>> Hi,
>>>> 
>>>> I have 2 files and would lime to see If one or both or none exist
>>>> 
>>>> I am using IDCAMS if-else sequence
>>>> With a command of print for this
>>>> 
>>>> However I am always coming up with a cc of 0 in the jcl for this step E.G.
>>>> Let's say filea is empty so is fileb
>>>> Print indataset(filea) count (1)
>>>> If lastcc ne 0 then do
>>>> Print indataset(fileb) count (1)
>>>> If lastcc = 0 then set lastcc = 8
>>>> Else
>>>> Set lastcc = 0
>>>> End
>>>> Else do
>>>> Print indataset(fileb) count(1)
>>>> If lastcc ne 0 then
>>>> Set lastcc = 4
>>>> End
>>>> 
>>>> I always cone up with a 0 for the IDCAMS job step when it should be in the 
>>>> case of 2 empty file 8
>>>> Sent from my iPhone
>>>> 
>>>> ----------------------------------------------------------------------
>>>> For IBM-MAIN subscribe / signoff / archive access instructions,
>>>> send email to [email protected] with the message: INFO IBM-MAIN
>>> ----------------------------------------------------------------------
>>> For IBM-MAIN subscribe / signoff / archive access instructions,
>>> send email to [email protected] with the message: INFO IBM-MAIN
>> 
>> ----------------------------------------------------------------------
>> For IBM-MAIN subscribe / signoff / archive access instructions,
>> send email to [email protected] with the message: INFO IBM-MAIN
> 
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to [email protected] with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to