Key position: is combination of (Staring and length of positions given below)
Location number (3,7)
division number (8,3)
item number (11,5)
File-2 : Record length - 150
it don't have any header and trailer
key position:
Location number (109,7)
division number (70,3)
item number (73,5)
i need to compare these 2 files (keys) and write record to output file only from file-1.
if the key from file-1 matches to file-2 then i cannot write that record to output.Only the record from file-1 which don't have matching key in file-2 will be written to output file.Also i need header and trailer records from fil-1 to output file and also i need updation of record count in trailer record ar position 109 to 112 ( 3bytes) of packed decimal fields.
Could you please let me know whether i can do it using syncsort or DFsort utitlity ? please help me.
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
Here's an example. There are lots here if you search. Look at the example and my suggestions, give it a go. If you get stuck, show us what you've done and what problem you encountered.
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
You don't need the columns on the BUILD, but other than that it looks OK. I've only looked, and not hard, and not tested.
Doesn't it feel better to get there yourself than to just take something and not know what it does? When you can, test, and make sure you understand it.
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
sivaprasad.gadhi,
If you need the original header and trailer you need to retain it using JNF1CNTL. You can use BUILD on JNF2CNTL to have only fields that you are going to match.
And you need to use IFTRAIL on the main task to update the trailer with the updated number of records.
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
No, I don't think SyncSort has IFTRAIL.
Perhaps append a sequence number to each record. Use IFTHEN=(WHEN=(trailerstart,trailerlength,CH,EQ,C'traileridentification') and OVERLAY the sequence number over the trailer count. You'll need to drop the extended sequence number. Since you have an IFTHEN, you could use IFOUTLEN=122.
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
If your trailer is just identifier plus count (or other "constant" data) you could OMIT it in the JNF1CNTL (so you have an up-to-date SyncSort (1.4.x)?) and use OUTFIL, TRAILER1 with REMOVECC and create your trailer with the TRAILER1.