View previous topic :: View next topic
|
Author |
Message |
ykishore
New User
Joined: 12 Aug 2005 Posts: 53 Location: USA
|
|
|
|
I am using the ICETOOL utility to selectively select some records from the input file. Before writing these records to the output file, I need to change the record contents based on some condition, say for eg a record has been selected and if the value in the 23 coloumn is '123', I need to make the value in the column 23 as '456' and then write this record to the output file
Regards,
Kishore.Y |
|
Back to top |
|
|
priyesh.agrawal
Senior Member
Joined: 28 Mar 2005 Posts: 1448 Location: Chicago, IL
|
|
|
|
Quote: |
I am using the ICETOOL utility to selectively select some records from the input file. |
Based on what condition you choose an I/p Record, which is to be updated at column 23.
Regards,
Priyesh. |
|
Back to top |
|
|
ykishore
New User
Joined: 12 Aug 2005 Posts: 53 Location: USA
|
|
|
|
Hi
Forget about the selection of records...but before writing to the o/p i need to write as per above requirement. |
|
Back to top |
|
|
priyesh.agrawal
Senior Member
Joined: 28 Mar 2005 Posts: 1448 Location: Chicago, IL
|
|
|
|
Code: |
//S0P0 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=HLQ.RECORDS.INPUT,DISP=SHR
//OUT DD DSN=HLQ.RECORDS.OUTPUT,
// DISP=(,CATLG,DELETE)
//TOOLIN DD *
COPY FROM(IN) TO(OUT) USING(CTL1)
/*
//CTL1CNTL DD *
OUTREC IFTHEN=(WHEN=(23,3,CH,EQ,C'123'),OVERLAY=(23:C'456'))
/*
// |
Regards,
Priyesh. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
If you're selecting the records with a SORT or COPY operator, then Priyesh's solution using DFSORT's OUTREC statement will work fine. However, if you're using a SELECT operator, you'll need to use OUTFIL rather than OUTREC, e.g.
Code: |
//S0P1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=HLQ.RECORDS.INPUT,DISP=SHR
//OUT DD DSN=HLQ.RECORDS.OUTPUT,
// DISP=(,CATLG,DELETE)
//TOOLIN DD *
SELECT FROM(IN) TO(OUT) ON(5,4,CH) FIRST -
USING(CTL1)
/*
//CTL1CNTL DD *
OUTFIL FNAMES=OUT,
IFTHEN=(WHEN=(23,3,CH,EQ,C'123'),OVERLAY=(23:C'456'))
/*
//
|
|
|
Back to top |
|
|
ykishore
New User
Joined: 12 Aug 2005 Posts: 53 Location: USA
|
|
|
|
Hi
Thanks alot !! |
|
Back to top |
|
|
|