I have to store current business date in fileA. I want to pick out the records from fileB whose date equals to that date in fileA.
How to write such sort statement ?
INCLUDE COND=(1,10,CH,EQ,C' I can't give any values here.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Please show an example of the records in fileA and fileB and what you want for the output records. What is the RECFM and LRECL of fileA and fileB? What is the starting position, length and format of the date fields?
Please show an example of the records in fileA and fileB and what you want for the output records. What is the RECFM and LRECL of fileA and fileB? What is the starting position, length and format of the date fields?
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
The DFSORT/ICETOOL job below will do what you asked for. Since you want the records in their original order rather than sorted by the date, you need an extra SORT operator. I assumed that your input files have RECFM=FB and LRECL=80 but the jobs can be changed appropriately for other attributes.
Frank,
I think this is not going to give me right output in some cases. Here my requirement is to check the existence of the dates in file 1 to that in file 2. But incase if I have this record 'bbbbbbb 2001/01/11' whose date is not in file 2 is occuring more than once like this
bbbbbbb 2001/01/11
kkkkkkk 2001/01/11
it's still going to give me an output like:
kkkkkkk 2001/01/11
So for those given set of records it working fine, but incase if i have dplicates dates in the file which are not present in the second file, its gonna give me wrong results.
So my basic requirement is to check the dates in the first file against those in the second file and then if present in the second file, copy them to the final output. Hope the requirement is clear.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Quote:
I think this is not going to give me right output in some cases.
The job I showed gives the output you asked for based on the example you showed. I can't read your mind to determine what other cases you might have. Please show a complete example of all of the input cases and what you want for output, and I'll give you a job that satisfies all of the cases you show me.