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
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Need to copy date from header of input file and append it.
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: 2150
Location: At my coffee table

PostPosted: Wed Nov 07, 2007 4:11 pm    Post subject: Re: Need to copy date from header of input file and append i
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    Post subject: Reply to: Need to copy date from header of input file and ap
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    Post subject:
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 Moderator


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

PostPosted: Wed Nov 07, 2007 9:53 pm    Post subject:
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    Post subject: Reply to: Need to copy date from header of input file and ap
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 Moderator


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

PostPosted: Thu Nov 08, 2007 10:39 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 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    Post subject:
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    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 Performing arithmetic on input field zh_lad DFSORT/ICETOOL 31 Tue Dec 06, 2016 8:04 pm
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am


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