vishal.iitr2003 Currently Banned New User
Joined: 25 Jan 2008 Posts: 18 Location: India
|
|
|
|
my input is something like this
aaaa1bbbb
aaaa1bbbb
aaaa2bbbb
aaaa2bbbb
whereever the fifth byte is 1 i need to change b's to c
but i dont want to touch records having 2 at fifth byte n copy them as they are.
I am able to achieve the first target by using following sort card
sort fields =copy
include cond = (5,a,ch,eq,'1')
outrec fields =(1:1,5,6:c'cccc)
but other records are getting filtered out....
what should i add in this sort card so that records having fifth byte =2 are copied without any change. |
|
ParagChouguley
Active User
Joined: 03 Feb 2007 Posts: 175 Location: PUNE(INDIA)
|
|
|
|
Code: |
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD *
AAAA1BBBB
AAAA1BBBB
AAAA2BBBB
AAAA2BBBB
/*
//OUT1 DD DSN=OUTPUT-FILE-NAME,
// DSORG=PS,RECFM=FB,
// DISP=(NEW,CATLG,DELETE)
//TOOLIN DD *
COPY FROM(IN1) TO(OUT1) USING(SRT1)
/*
//SRT1CNTL DD *
OPTION COPY
OUTREC IFTHEN=(WHEN=(5,1,CH,EQ,C'1'),
BUILD=(1,5,C'CCCC')),
IFTHEN=(WHEN=NONE,
BUILD=(1,9))
/*
|
Output:
Code: |
AAAA1CCCC
AAAA1CCCC
AAAA2BBBB
AAAA2BBBB
|
--Parag |
|