Now, based on the flag, it should eliminate records belonging to a CaseID
with priority in order of ' ' (space) > 'S' > 'C'
i.e. say if two records with 'S' and ' ' are present for a CASEID, the output
should contain all the record(s) with ' ' flag
or say if 'C' and 'S' flag types of records are present for a CASEID, the output should contain all the record(s) with 'S' flag
The expected output for above example file is given below:
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
You can use a DFSORT job like the following to do what you asked for. I assumed your input file has RECFM=FB and LRECL=80, but the job can be changed appropriately for other attributes.
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
yespatel,
The following DFSORT JCL will give you the desired results. I assumed your input file has RECFM=FB and LRECL=80, but the job can be changed appropriately for other attributes.
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
Hello,
Quote:
COBOL solution doesn't look feasible to me,
FWIW, the cobol solution is rather trivial - basically the same as Skolusu posted. . .
Create a new sort key for the " ", C, and S (i.e. 1, 2, 3) and internally sort the file by case and the new key, then only write the records that contain the highest "priority" for that case to the output file.