IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search Log in to check your private messages Log in
 

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: 7312
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 All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Forum Replies
No new posts Inserting records into the empty segm... IMS DB/DC 0
No new posts JCL to extract repeating records DFSORT/ICETOOL 6
No new posts Group selective VB records - Trailer ... DFSORT/ICETOOL 16
No new posts How to process dependent file based o... JCL & VSAM 8
This topic is locked: you cannot edit posts or make replies. SORT the records based on the second ... SYNCSORT 1

Back to Top