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
 

 

Copy part of Trailer into Header

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

New User


Joined: 18 Dec 2007
Posts: 51
Location: delaware

PostPosted: Wed Apr 09, 2008 8:58 pm    Post subject: Copy part of Trailer into Header
Reply with quote

Experts:

I have an output file from my program which looks like

Code:

Command ===>                                                  Scroll ===> CSR 
****** ***************************** Top of Data ******************************
000001 00001HEADER 20080409                                                   
000002      0000000000000000038762924 0     0 20080409  000003499642813800 DEBI
000003      0000000000000000038762975 0054790 20080409  000000948910953600 DEBI
000004      0000000000000000038762983 0556001 20080409  000000116843296600 DEBI
000005      0000000000000000038762991 0556004 20080409  000000122202339400 DEBI
000006      0000000000000000038763089 0     0 20080409  000000003372714900 DEBI
000007      0000000000000000038756364 0     0 20080409  000000185440641600 DEBI
000008 00001       200804090755110000487641275990000000000000000000           
****** **************************** Bottom of Data ****************************



It is a 255 byte file. The final requirement is , I need to copy part of the trailer record,(identified by 00001) onto the Header Record .


Please let me know if you need any clarification . Thank you in Advance.
Back to top
View user's profile Send private message

kirankumarj

New User


Joined: 18 Dec 2007
Posts: 51
Location: delaware

PostPosted: Wed Apr 09, 2008 8:59 pm    Post subject: After copying the trailer record:
Reply with quote

Header record should look like :

00001HEADER 200804090755110000487641275990000000000000000000
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


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

PostPosted: Wed Apr 09, 2008 9:38 pm    Post subject:
Reply with quote

Here's a DFSORT job that will do what you asked for:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (FB/255)
//SORTOUT DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN    DD    *
  OPTION COPY
  INCLUDE COND=(1,5,CH,EQ,C'00001',AND,6,6,CH,NE,C'HEADER')
  OUTREC BUILD=(C'TCON,''',21,40,C'''',80:X)
/*
//S2    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)
//SORTIN DD DSN=...  input file (FB/255)
//SORTOUT DD DSN=...  output file (FB/255)
//SYSIN    DD    *
  OPTION COPY
  INREC IFTHEN=(WHEN=(1,11,CH,EQ,C'00001HEADER'),
    OVERLAY=(21:TCON))
/*
Back to top
View user's profile Send private message
kirankumarj

New User


Joined: 18 Dec 2007
Posts: 51
Location: delaware

PostPosted: Wed Apr 09, 2008 9:59 pm    Post subject: Thank you Frank
Reply with quote

That worked. Thanks a bunch.
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 SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts HALDB data refresh/copy from producti... vineetanand2007 IMS DB/DC 0 Mon Jan 02, 2017 11:16 am
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm


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