If 1,1,CH,EQ,A => I need to write in an output file
In the unmatched records of the above condition, i need to check for
3,3,ch,eq,'ROT'
In the unmatched records of the above two conditions, I need to Check for some more conditions. Like this I have to write 40 conditions.
The query is, whether is there any way of writting the unmatched records of any include statement into another temporary file, without adding any OMIT condition and pointing to the output DSN?
Joined: 15 Feb 2005 Posts: 7130 Location: San Jose, CA
Quote:
The query is, whether is there any way of writting the unmatched records of any include statement into another temporary file, without adding any OMIT condition and pointing to the output DSN?
I don't understand what you mean by this. How can you write into a temporary file without pointing to the temporary file - how would you know where to write to? And I have no idea what you mean by "without any OMIT condition".
Perhaps if you showed an example of your input records and what you want for output, it would help clarify what you're trying to do.
Output 2:
In unmatched records in the above condition with 3,1 = B
Output 3:
In unmatched records in the above two conditions with 6,1 = 9
Output 4:
In unmatched records in all the above conditions with 15,3 = TCS
Output 5:
In unmatched records in all the above conditions with 9,6 = TANDEN
Due to some reasons I cant able to give the exact details of my DSN. Sorry for that. But in my scenario there are 20 such conditions and hence I need to write 20 output files. I tried in the following way:
OUTFIL FNAME=OUT1
Include Cond=(1,1,CH,EQ,A)
OUTFIL FNAME=OUT2
omit Cond=(1,1,CH,EQ,A)
Then I tried using the OUT2 as the input for the next sort.
So my query is, is there anyway that we could move the unmatched records into another temporaty file, upon which I can do further manipulation.
If you are still not clear, please make a note to me, So that I could try to explain more on my requirement.
Joined: 15 Feb 2005 Posts: 7130 Location: San Jose, CA
I believe a DFSORT job like the following will do what you want. I assumed that your input file has RECFM=FB and LRECL=80, but the job can be changed appropriately for other attributes. Each IFTHEN clause sets a file number in position 81 if its condition is met. Once an IFTHEN clause is met for a record, IFTHEN processing stops for that record, so this has the effect of checking "unmatched" records for the conditions. The OUTFIL statements then use the file number in 81 to write the selected records to each file.
I have multiple records in a file which has got different dates starting from tomorrow to the next 21 days. I need to separate the records in such a way that each day?s records are stored in different files. I mean 21 different output files.
The date format is YYYYWWD(Year, week, day) and it is CHAR(7). The LRECL of the file is 80, and the starting position of the date field is 66.
Can you please advice me how can I acheive this in SORT?
If you need the date constants generated dynamically, DFSORT does not have any built-in functions to do that for a yyyywwd date. It can do it for yyyymmdd (DATE1+1,..., DATE1+21) dates and for yyyyddd (DATE3+1, DATE3+21) dates, but not for yyyywwd dates.