Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Write multiple records based on a template and input file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Write multiple records based on a template and input file
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10326
Location: italy

PostPosted: Tue Sep 13, 2011 9:55 pm    Post subject: Reply to: Write multiple records based on a template and inp
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 Moderator


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

PostPosted: Tue Sep 13, 2011 11:23 pm    Post subject:
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: 6968
Location: porcelain throne

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

regardless if the TS gets back,
i think that modifying this solution by Frank will do the trick:
http://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

Global Moderator


Joined: 14 Mar 2007
Posts: 10326
Location: italy

PostPosted: Fri Sep 16, 2011 11:49 pm    Post subject: Reply to: Write multiple records based on a template and inp
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    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 How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us