View previous topic :: View next topic
Author
Message
manoz_k New User Joined: 08 Mar 2007Posts: 23 Location: CHENNAI
I have following Control Card which replaces based on the condition
Code:
OPTION COPY
INREC IFTHEN=(WHEN=(23,1,CH,NE,C'1'),
FINDREP=(IN=X'00',OUT=X'40'))
But what change i need to do if i want to change specific bytes only..
Suppose if 23 Byte is not C'1' i want to change all NULLS from Pos-30 to Pos-40 to Blanks.
How can i specify location while using FINDREP ?
Back to top
gcicchet Senior Member Joined: 28 Jul 2006Posts: 1702 Location: Australia
Back to top
Frank Yaeger DFSORT Developer Joined: 15 Feb 2005Posts: 7129 Location: San Jose, CA
Manoj,
You can use these DFSORT control statements:
Code:
OPTION COPY
INREC IFTHEN=(WHEN=(23,1,CH,NE,C'1'),
FINDREP=(IN=X'00',OUT=X'40',STARTPOS=30,ENDPOS=40))
For complete details on DFSORT's FINDREP function, see:
www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000085
Back to top
manoz_k New User Joined: 08 Mar 2007Posts: 23 Location: CHENNAI
Frank Yaeger wrote:
Manoj,
You can use these DFSORT control statements:
Code:
OPTION COPY
INREC IFTHEN=(WHEN=(23,1,CH,NE,C'1'),
FINDREP=(IN=X'00',OUT=X'40',STARTPOS=30,ENDPOS=40))
For complete details on DFSORT's FINDREP function, see:
www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000085
Frank,
I have two conditions here
1) WHEN=(23,1,CH,NE,C'1')
2) WHEN=(23,1,CH,EQ,C'1')
and based on that i have two different actions respectively
FINDREP=(IN=X'00',OUT=X'40',STARTPOS=30,ENDPOS=40))
FINDREP=(IN=X'00',OUT=X'40',STARTPOS=819,ENDPOS=860))
I want something like
Code:
OPTION COPY
INREC IFTHEN=(WHEN=(23,1,CH,EQ,C'1'),
FINDREP=(IN=X'00',OUT=X'40',STARTPOS=37,ENDPOS=900))
INREC IFTHEN=(WHEN=(23,1,CH,NE,C'1'),
FINDREP=(IN=X'00',OUT=X'40',STARTPOS=819,ENDPOS=834))
But i could not mimic two FINDREPs together with two WHEN conditions.
Back to top
Frank Yaeger DFSORT Developer Joined: 15 Feb 2005Posts: 7129 Location: San Jose, CA
You need to use one INREC with two IFTHEN clauses, not two INRECs. You need to use HIT=NEXT for the first IFTHEN clause. Here are the DFSORT statements:
Code:
OPTION COPY
INREC IFTHEN=(WHEN=(23,1,CH,EQ,C'1'),
FINDREP=(IN=X'00',OUT=X'40',STARTPOS=37,ENDPOS=900),
HIT=NEXT),
IFTHEN=(WHEN=(23,1,CH,NE,C'1'),
FINDREP=(IN=X'00',OUT=X'40',STARTPOS=819,ENDPOS=834))
Note that you could use WHEN=NONE for the second IFTHEN clause.
Back to top
manoz_k New User Joined: 08 Mar 2007Posts: 23 Location: CHENNAI
Thank you very much Frank. It worked well.I corrected my mistake of using INREC twice.
Back to top
Please enable JavaScript!