Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
How to replace Trailer information with header information

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

New User


Joined: 07 Sep 2010
Posts: 22
Location: hyderabad

PostPosted: Tue Feb 24, 2015 1:12 pm    Post subject: How to replace Trailer information with header information
Reply with quote

Hello,

I have a file like below.

Header 123456789 ABCDEFGHIJ
hello world
hello world
hello world
-
-
Trailer 11111111 XYZ12345678

So, the requirement is to update the particular position in trailer record with header information. Lets say XYZ to be updated with ABC
My final trailer would be like below...

Trailer 11111111 ABC12345678


Could anybody in the group please let me know how to achieve this by using SORT utility.
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Tue Feb 24, 2015 1:43 pm    Post subject: Reply to: How to replace Trailer information with header inf
Reply with quote

INREC IFHTHEN=(WHEN=GROUP it identify the header, then PUSH to a temporary extension of the record. IFTHEN=(WHEN=(logical-expression to identify the trailer, and copy the content from the extension. Use IFOUTLEN (fixed-length records) or BUILD to remove the extension.
Back to top
View user's profile Send private message
somapradeep1

New User


Joined: 07 Sep 2010
Posts: 22
Location: hyderabad

PostPosted: Tue Feb 24, 2015 2:24 pm    Post subject:
Reply with quote

Thanks Bill. If possible, Could you please provide me a sample code of the logic
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Tue Feb 24, 2015 2:34 pm    Post subject: Reply to: How to replace Trailer information with header inf
Reply with quote

Code:
 INREC IFTHEN=(WHEN=GROUP,
                BEGIN=(1,6,CH,EQ,C'Header'),
                PUSH=(81:19,3)),
       IFTHEN=(WHEN=(1,7,CH,EQ,C'Trailer'),
                OVERLAY=(19:81,3)),
       IFOUTLEN=80


Should be close. That assumes fixed-length 80-byte records.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Tue Feb 24, 2015 2:52 pm    Post subject: Reply to: How to replace Trailer information with header inf
Reply with quote

Code:
 INREC IFTHEN=(WHEN=INIT,
                BUILD=(1,4,3X,5)),
       IFTHEN=(WHEN=GROUP,
                BEGIN=(8,6,CH,EQ,C'Header'),
                PUSH=(5:26,3)),
       IFTHEN=(WHEN=(8,7,CH,EQ,C'Trailer'),
                OVERLAY=(26:5,3))
 OUTFIL BUILD=(1,4,8)


That's for variable-length records. Done quickly, so fix any typos yourself if possible.
Back to top
View user's profile Send private message
somapradeep1

New User


Joined: 07 Sep 2010
Posts: 22
Location: hyderabad

PostPosted: Tue Feb 24, 2015 3:12 pm    Post subject:
Reply with quote

Excellent Bill. The logic is working fine. Thanks a lot!!! icon_biggrin.gif icon_biggrin.gif
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 Updating multiple counts in trailer!! Vignesh Sid SYNCSORT 4 Mon Nov 06, 2017 1:04 pm
No new posts Information About the Equifax Securit... Rohit Umarjikar PC Guides & IT News 6 Mon Sep 11, 2017 9:10 pm
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm
No new posts SORT Trailer Count - LRECL Output co... amorante DFSORT/ICETOOL 5 Tue Aug 29, 2017 8:57 pm
No new posts retrieving envelope information out o... VintageReceiver TSO/ISPF 6 Thu Aug 10, 2017 8:13 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us