View previous topic :: View next topic
|
Author |
Message |
janakimaviti
New User
Joined: 02 Feb 2006 Posts: 2
|
|
|
|
HI,
I have a requirement that in a file of 283 length if value other than 41 in the place of (282,2), i have to replace it with 41.
The field in the position 282 of length 2 bytes is Binary.
I hope I can do this with INREC, IFTHEN and BUILD.
But I need the syntax for processing Binary fields.
Thanks & Regards,
Hema. |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
If the value is not 41 then replace it with 41? How about if the value is 41, replace it with 41? How about just plug 41 regardless of what is there?
Your requirement is very simple, just a copy with an outrec something like 1:1,281,282:'41',2,BI - but that is just from a faulty memory. Why don't you look up the actual format in your sort manual? |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Well, like William says, you could simplify this to always put +41 in binary into 282-283 with these DFSORT statements:
Code: |
OPTION COPY
INREC OVERLAY=(282:+41,TO=BI,LENGTH=2)
|
But if you really want to do the test, you can use these statements:
Code: |
OPTION COPY
INREC IFTHEN=(WHEN=(282,2,BI,NE,+41),
OVERLAY=(282:+41,TO=BI,LENGTH=2))
|
|
|
Back to top |
|
|
|