Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Inserting new records based on grouping

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
mohitsaini
Warnings : 1

New User


Joined: 15 May 2006
Posts: 90

PostPosted: Thu Sep 19, 2013 5:03 pm    Post subject: Inserting new records based on grouping
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7251

PostPosted: Fri Sep 20, 2013 2:26 pm    Post subject: Reply to: Inserting new records based on grouping
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    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 Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us