columns 1 thru 9 has U_ID (header absent in this file)
column 10 has delimiter '|'
column 11 thru 41 has USER_TYPE (header absent in this file)
column 42 has the delimiter '|'
column 43 thru 80 has spaces
b) Records already sorted by U_ID in ascending order.
NOTE - in this example, the last 3 records in the second file appear in the first file as the last 3 records, though the 'common' records between the two files
can exist anywhere in the first file.
------------------------------------------------------------------
3. Requirement is to compare the two files based on U_ID and create a third file which has ALL records in the first file PHRD.TEST1, but NONE from the second file PHRD.TEST2.
a) Output file will have lrecl=80, recfm = FB.
b) It will have the header record and look as follows
c) Retain the order of records in the first file, but remove records that exist in the second file based on U_ID.
Code:
U_ID USER TYPE
100014730|Unit/Department Approver |
100018981|Unit/Department Approver |
100076455|Unit/Department Approver |
100076455|Creator |
100339086|Creator |
100430547|Dean/Department Head Approver |
100430547|Equity Administrator |
100687514|Dean/Department Head Approver |
-------------------------------------------------------------
The JCL listed below does not give the desired results.
Using 'NODUPS USING(CTL3)' removes duplicates from the first file and using
'ALLDUPS USING(CTL3)' removes the records with single U_ID.
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
Suresh Shankarakrishnan,
The reason the sample job gives you incorrect results is because you have duplicates in your file PHRD.TEST1 on the key 1,9. and the select parm is removing them. You need to pick the right example.
Anyway here is a simple version of the job which would give you the desired results