Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
If else usage for different conditions

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL
Author Message
bhaskar_kanteti

Active User


Joined: 01 Feb 2007
Posts: 79
Location: India

PostPosted: Sat Apr 12, 2008 3:55 pm    Post subject: If else usage for different conditions
Reply with quote

Hi,

How can i execute 4 different programs based on 2 field values in my input file.
My input file is of rec length = 10 and it is as follows
Code:

NAME VALUE
SEQ  1     
ORD  1     

Always there will be two records with names Seq and Ord.
Position 1,5 will have the name and
Position 6,5 will have the value
The possible values for seq num and ord num are
Code:

SEQ ORD
1   1   
1   2   
2   1   
2   2   


So
If Seq=1 and Ord=1
Exec=Pgm1
Else if Seq=1 and Ord=2
Exec=Pgm2
Else if Seq=2 and Ord=1
Exec=Pgm3
Else
Exec=Pgm4
End-if

How can i do this using jcl.
I think by using SORT and NULLOUT=RC* i can do this. Am i right.
If so how can i assign maxcc value for all the four conditions.
I need some guidence regarding this.
Back to top
View user's profile Send private message
References
PostPosted: Sat Apr 12, 2008 3:55 pm    Post subject: Re: If else usage for different conditions Reply with quote

CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 1087
Location: At my desk

PostPosted: Sat Apr 12, 2008 8:54 pm    Post subject:
Reply with quote

Other than running four (or three if you want to default the last one) sorts and using condition checking, I can't see a way of doing this with sort.
It would take the tinyest COBOL bit of coding to set the return code to one of the four values you need in a single pass.
Back to top
View user's profile Send private message
shankar.v

Active User


Joined: 25 Jun 2007
Posts: 182
Location: Bangalore

PostPosted: Sun Apr 13, 2008 1:25 am    Post subject:
Reply with quote

bhaskar_kanteti,
Quote:
I think by using SORT and NULLOUT=RC* i can do this. Am i right

Please check with the following code for your requirement.
Code:
// EXEC PGM=IEFBR14                                                             
//DELETE DD DSN=TEMPIN,DISP=(MOD,DELETE,DELETE)                                 
//S1 EXEC PGM=ICETOOL                                                           
//TOOLMSG DD SYSOUT=*                                                           
//DFSMSG DD SYSOUT=*                                                           
//IN DD *                                                                       
SEQ  2                                                                         
ORD  2                                                                         
/*                                                                             
//TEMPIN DD DISP=(,CATLG),LRECL=80,RECFM=FB,SPACE=(CYL,1),                     
// DSN=TEMPIN                                                                   
//TEMP DD DSN=&&TEMP,DISP=(,PASS)                                               
//TOOLIN DD *                                                                   
 COPY FROM(IN) TO(TEMPIN) USING(CTL1)                                           
 COPY FROM(TEMPIN) TO(TEMP) USING(CTL2)                                         
 COUNT FROM(TEMP) LOWER(2) RC4                                                 
/*                                                                             
//CTL1CNTL DD *                                                                 
 INREC OVERLAY=(11:SEQNUM,1,ZD)                                                 
//CTL2CNTL DD *                                                                 
 INCLUDE COND=((11,1,ZD,EQ,+1,AND,6,5,CH,EQ,C'1'),OR,                           
               (11,1,ZD,EQ,+2,AND,6,5,CH,EQ,C'1'))                             
/*                                                                             
// IF (RC = 0) THEN                                                             
//PGM1 EXEC PGM=PGM1                                                           
// ELSE                                                                         
//S2 EXEC PGM=ICETOOL                                                           
//TOOLMSG DD SYSOUT=*                                                           
//DFSMSG DD SYSOUT=*                                                           
//TEMPIN DD DSN=TEMPIN,DISP=SHR                                                 
//TEMP DD DSN=&&TEMP,DISP=(,PASS)                                               
//TOOLIN DD *                                                                   
 COPY FROM(TEMPIN) TO(TEMP) USING(CTL1)                                         
 COUNT FROM(TEMP) LOWER(2) RC4                                                 
/*                                                                             
//CTL1CNTL DD *                                                                 
 INCLUDE COND=((11,1,ZD,EQ,+1,AND,6,5,CH,EQ,C'1'),OR,                           
               (11,1,ZD,EQ,+2,AND,6,5,CH,EQ,C'2'))                             
/*                                                                             
// IF (S2.RC = 0) THEN                                                         
//PGM2 EXEC PGM=PGM2                                                           
// ELSE                                                                         
//S3 EXEC PGM=ICETOOL                                                           
//TOOLMSG DD SYSOUT=*                                                           
//DFSMSG DD SYSOUT=*                                                           
//TEMPIN DD DSN=TEMPIN,DISP=SHR                                                 
//TEMP DD DSN=&&TEMP,DISP=(,PASS)                                               
//TOOLIN DD *                                                                   
 COPY FROM(TEMPIN) TO(TEMP) USING(CTL1)                                         
 COUNT FROM(TEMP) LOWER(2) RC4                                                 
/*                                                                             
//CTL1CNTL DD *                                                                 
 INCLUDE COND=((11,1,ZD,EQ,+1,AND,6,5,CH,EQ,C'2'),OR,                           
               (11,1,ZD,EQ,+2,AND,6,5,CH,EQ,C'1'))                             
/*                                                                             
// IF (S3.RC = 0) THEN                                                         
//PGM3 EXEC PGM=PGM3                                                           
// ELSE                                                                         
//PGM4 EXEC PGM=PGM4                                                           
// ENDIF                                                                       
// ENDIF                                                                       
// ENDIF                                                                       
// EXEC PGM=IEFBR14                                                             
//DELETE DD DSN=TEMPIN,DISP=(MOD,DELETE,DELETE)                                 
Back to top
View user's profile Send private message
Moved: Sun Apr 13, 2008 4:55 am by Frank Yaeger From DFSORT/ICETOOL to JCL
bhaskar_kanteti

Active User


Joined: 01 Feb 2007
Posts: 79
Location: India

PostPosted: Sat May 17, 2008 12:12 pm    Post subject: Reply to: If else usage for different conditions
Reply with quote

Hi shankar,

Thankyou so much.
Its working.
Sorry for late response.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL All times are GMT + 6 Hours
Page 1 of 1