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

Inserting new records based on grouping


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

New User


Joined: 15 May 2006
Posts: 92

PostPosted: Thu Sep 19, 2013 5:03 pm
Reply with quote

Hi All,

I am struggling with creating a JCL:

My requirement is whenever my key field changes (in bold below) in a file then I need to insert two records from a different file and write the key field in those two new inserted records. Below is the example

Input file:
12345AAAA67890
12335AAAA67890
12395AAAA67890
23454BBBB12344
23452BBBB12344
12345CCCC45678
12346CCCC45678
12347CCCC45678

input File 2
00000000000000
99990000000000

Output should look like below
12345AAAA67890
12335AAAA67890
12395AAAA67890
0000AAAA000000
9999AAAA000000

23454BBBB12344
23452BBBB12344
0000BBBB000000
9999BBBB000000

12345CCCC45678
12346CCCC45678
12347CCCC45678
0000CCCC000000
9999CCCC000000


The above under lined records needs to be inserted from a different file if my key field value differs.

Please note that all the files are VB here.

Any kind of help will be really appreciated
Regards,
Mohit
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Sep 20, 2013 2:26 pm
Reply with quote

You can use this one to base your Control Cards on.

You need to put the "last reord" marker in an extension to your record.

You need to have OUTFIL and to test the extension. When true, BUILD the original record, and use the slash operator "/" twice to get your new records inserted in the correct place.

To get the values for your new records, have a short step which generates to symbols/SYMNAMES from the records on your two-record file.

Add those SYMNAMES to your processing step, and use the values to insert the new records.
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 only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Grouping by multiple headers DFSORT/ICETOOL 7
No new posts Join multiple records using splice DFSORT/ICETOOL 5
No new posts EZT program to build a flat file with... All Other Mainframe Topics 9
Search our Forums:

Back to Top