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

Write multiple records based on a template and input file


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

New User


Joined: 10 Jun 2008
Posts: 24
Location: india

PostPosted: Tue Sep 13, 2011 9:52 pm
Reply with quote

I have a requirement to write multiple records to an output file based on the provided template and the input file. Fields from the input file would be written to the output file based on the template record.

For example,
Template record:
XXXX,YYYY,A,B,C,D

Input file:
1111,2222
3333,4444
5555,6666
7777,8888

Output file expected:
1111,2222,A,B,C,D
3333,4444,A,B,C,D
5555,6666,A,B,C,D
7777,8888,A,B,C,D

How can this be achieved? I tried to achieve this with multiple logics - one is to repeat the template record to the number of records in the input file and join them. It didn't work as I didn't find any clue to do that. Input file count is expected to be in millions.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue Sep 13, 2011 9:55 pm
Reply with quote

You must do a better job in explaining Your requirement.
the wording tells something, but the example tells something much simpler

the wording implies some kind of pattern matching,
the example can be solved by a simple copy with the proper build statements

rethink on how to explain better the whole shebang icon_biggrin.gif
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: Tue Sep 13, 2011 11:23 pm
Reply with quote

Quote:
based on the provided template and the input file


How can you expact anyone to help you when you've shown us only one possible template, and not explained the rules for what the template can look like and how it should be applied to the other file's records?

You need to do a much better job of explaining what you're trying to do and all the possible variations before anyone can help you.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Sep 16, 2011 11:33 pm
Reply with quote

regardless if the TS gets back,
i think that modifying this solution by Frank will do the trick:
ibmmainframes.com/viewtopic.php?p=106139&highlight=append#106139

now i realize that it does not have the 'dynamic nature' of finding and using a found datafield,
but, if file 1 just contained the data to be used as the overlay value,
something slick could be created to create a dynamic sysname from file 1,
and a search for last non-char (first space) for overlay start could be created.

but, then again, how many different file types would you want to append data?
inotherwords, minor change of control cards for different files.

sorry guys, it is friday night, been a loooooong week,
don't know when to shut-up.

have a good weekend.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Fri Sep 16, 2011 11:49 pm
Reply with quote

Quote:
don't know when to shut-up.

if You knew we would lose half of the fun of hanging around here 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 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 Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
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 Extract the file name from another fi... DFSORT/ICETOOL 6
Search our Forums:

Back to Top