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

Insert extra bytes for a particular type of record


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 7
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts Validating record count of a file is ... DFSORT/ICETOOL 13
Search our Forums:

Back to Top