|
|
| Author |
Message |
bhaskar_kanteti
Active User
Joined: 01 Feb 2007 Posts: 85 Location: India
|
|
|
|
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 |
|
 |
References
|
Posted: Sat Apr 12, 2008 3:55 pm Post subject: Re: If else usage for different conditions |
 |
|
|
 |
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 1199 Location: At my desk
|
|
|
|
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 |
|
 |
shankar.v
Active User
Joined: 25 Jun 2007 Posts: 182 Location: Bangalore
|
|
|
|
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 |
|
 |
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: 85 Location: India
|
|
|
|
Hi shankar,
Thankyou so much.
Its working.
Sorry for late response. |
|
| Back to top |
|
 |
|
|
|