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

 


Similar Topics
Topic Forum Replies
No new posts Sort SMF records? SYNCSORT 6
No new posts To Sort detail records in a file with... SYNCSORT 5
No new posts Identify and write records containing... SYNCSORT 11
No new posts Filter records where condition is in ... SYNCSORT 6
No new posts Extract records for a specific condit... DFSORT/ICETOOL 25
Search our Forums:


Back to Top