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

Need to copy date from header of input file and append it.


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
aditya_gorti

New User


Joined: 21 Dec 2005
Posts: 19

PostPosted: Wed Nov 07, 2007 4:02 pm
Reply with quote

Hi,

I need to copy the date from the header record of the input file.
and append it at the end to every record of the output file.

Can we do it thru DFSORT..?
Please help me with that.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Wed Nov 07, 2007 4:11 pm
Reply with quote

aditya_gorti wrote:
Can we do it thru DFSORT..?
Probably.....
Quote:
Please help me with that.
Please help us by providing small examples of your input, output, lrecl and recfm.....
Back to top
View user's profile Send private message
aditya_gorti

New User


Joined: 21 Dec 2005
Posts: 19

PostPosted: Wed Nov 07, 2007 4:11 pm
Reply with quote

Just adding some more details..

I have a header record and say "n" records in the input file.
So I need to copy all the "n" records from the input to output
file, as it is and take the date from header record of input file
and append it at the end of each of the "n" records in the output
file.

hope this will be some more help.

thanks,
Adi
Back to top
View user's profile Send private message
aditya_gorti

New User


Joined: 21 Dec 2005
Posts: 19

PostPosted: Wed Nov 07, 2007 4:20 pm
Reply with quote

ok.. sure..

here u go with the details:

The inpu file is a sequential with recfm- FBA and lrecl - 81.
The date is from position 1 to 8 in the format "11/02/07".

The output needs to be with all the information what the input has
just by including the date "11/02/07" at the end of each record.

does this help..?
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 Nov 07, 2007 9:53 pm
Reply with quote

Do you want the header record in the output file?

Do you want the date from the header added in positions 82-89 of the output file?

Since this is an FBA input file, it has an ANSI carriage control character in position 1 (e.g. '1' for eject). So does the date in the header record really start at position 2? Do you want the output file to be FBA and include the ANSI carriage control character in each record, or do you want to drop the first byte and make the output FB?

It would really help if you would show an example of what the input records and expected output records look like (just a few records).
Back to top
View user's profile Send private message
aditya_gorti

New User


Joined: 21 Dec 2005
Posts: 19

PostPosted: Thu Nov 08, 2007 8:03 pm
Reply with quote

The header record will look like :

cols:
(2-9) (30-52) (74-81)

10/30/07 XXXXXXXX PAGE 1

The records will look like following:
Cols:

(2-5) (12-20) (22-33) (58-81)

0003 123456789 ABCDEF XXXXX XXXXXXX
0003 123456789 ABCDEF XXXXX XXXXXXX
0003 123456789 ABCDEF XXXXX XXXXXXX
0003 123456789 ABCDEF XXXXX XXXXXXX


My records should look like :
Cols:

(2-5) (12-20) (22-33) (58-81) (83-90)

0003 123456789 ABCDEF XXXXX XXXXXXX AAAAAA
0003 123456789 ABCDEF XXXXX XXXXXXX AAAAAA
0003 123456789 ABCDEF XXXXX XXXXXXX AAAAAA
0003 123456789 ABCDEF XXXXX XXXXXXX AAAAAA

where AAAAAA is the date copied from the header.
Output file also needs to be in FBA format.

Please let me know if you need anything else..

Thanks
Adi
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: Thu Nov 08, 2007 10:39 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 file1 with date (FB/81)
//SORTOUT DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN    DD    *
  OPTION COPY
  OUTREC BUILD=(C'MYDATE,''',2,8,C'''',80:X)
/*
//S2    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)
//SORTIN DD DSN=...  input file2 with records (FB/81)
//SORTOUT DD DSN=...  output file (FB/90)
//SYSIN    DD    *
  OPTION COPY
  INREC OVERLAY=(83:MYDATE)
/*
Back to top
View user's profile Send private message
aditya_gorti

New User


Joined: 21 Dec 2005
Posts: 19

PostPosted: Mon Nov 12, 2007 4:31 pm
Reply with quote

It's working! Thanks a lot!! icon_smile.gif
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 Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts TRIM everything from input, output co... DFSORT/ICETOOL 1
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
Search our Forums:

Back to Top