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

Copy part of Trailer into Header


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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
Reply with quote

Header record should look like :

00001HEADER 200804090755110000487641275990000000000000000000
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: Wed Apr 09, 2008 9:38 pm
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts VB to VB copy - Full length reached SYNCSORT 8
No new posts Need COBOL COPY Help in MVS Environment COBOL Programming 4
No new posts Issue after ISPF copy to Linklist Lib... TSO/ISPF 1
No new posts Insert header record with record coun... DFSORT/ICETOOL 14
No new posts DB2 Table - Image copy unload IBM Tools 2
Search our Forums:

Back to Top