Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Insert extra bytes for a particular type of record

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
hsk

New User


Joined: 28 Nov 2006
Posts: 69
Location: India

PostPosted: Thu Feb 05, 2009 11:14 am    Post subject: Insert extra bytes for a particular type of record
Reply with quote

I have a file of length 80 in the format like

Header1
Header2
Detail1
Detail2
Detail1
Detail2
Detail1
Detail2
Trailer
Header1
Header2
Detail1
Detail2
.............. so on

I want to insert 2 bytes '00' at 5th position of the Detail2 record. Don't want to change anyother record. I can not spilt/remerge file.
Is it possible thru DFSORT to check whether it's a Detail2 record and insert 2 additional bytes.

Sample i/p
010HHHH1
020HHHH2
031DDDD1
032DDDD2
99TTTTTTT

Expected o/p
010HHHH1
020HHHH2
031DDDD1
032D00DDD2
99TTTTTTT
Back to top
View user's profile Send private message

km_abdullah

New User


Joined: 03 Nov 2008
Posts: 60

PostPosted: Thu Feb 05, 2009 11:39 am    Post subject:
Reply with quote

Hello hsk,

My understanding is Detail2 record is identified by characters 'D2' in 7-8 columns. Is this correct? If so below code will work -

Code:
//SYSIN DD *                           
 SORT    FIELDS=COPY                   
 OUTREC IFTHEN=(WHEN=(7,2,CH,EQ,C'D2'),
    BUILD=(1,4,C'00',5,74))           


Hi all,
Please let me know if any other simpler method is available.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts SORT JSON type of data maxsubrat DFSORT/ICETOOL 8 Wed Apr 19, 2017 6:01 pm
No new posts Sort Large record length cmsmoon DFSORT/ICETOOL 14 Tue Apr 11, 2017 5:49 pm
No new posts Format record to remove Leading zeroes Learncoholic DFSORT/ICETOOL 14 Wed Apr 05, 2017 2:43 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us