IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Syntax for processing Binary fields using INREC


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
janakimaviti

New User


Joined: 02 Feb 2006
Posts: 2

PostPosted: Fri Feb 09, 2007 12:17 pm
Reply with quote

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
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Fri Feb 09, 2007 3:11 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Fri Feb 09, 2007 9:28 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts Concatenate 2 fields (usage national)... COBOL Programming 2
No new posts INREC PARSE used to sort a CSV file DFSORT/ICETOOL 2
No new posts Cobol COMP-2 fields getting scrambled... Java & MQSeries 6
No new posts Converting unpacked fields to pack us... SYNCSORT 4
Search our Forums:

Back to Top