how can I change that sort, so write the file ONLYF1 with everything except what is in OTHER. without writing the conditions:
Change your OUTFIL for ONLYF1 as below.
Code:
OUTFIL FNAMES=ONLYF1,BUILD=(1,290),SAVE
SAVE selects the records that are not selected for any other OUTFIL group.
Also,please note in your earlier conditions, your 2 OUTFIL were looking for
INCLUDE=(291,1,ZD,EQ,1,.....
and
INCLUDE=(291,1,ZD,GT,2.....
You are likely to miss records where 291 position value is equal to 2. Don't know if that's an issue or not but just wanted to bring this point to your attention.
write the file ONLYF1 with everything except what is in OTHER
Yes, the headers will fall into ONLYF1. That is everything except what is in OTHER file.
I think OP here was trying to debug his process to find out dropped records and that's what I have pointed out in my earlier post about his include conditions. He also said without any INCLUDE Condition. But if he needs to drop the header records then he will have to change his cards.
Quote:
without writing the conditions:
Code:
INCLUDE=(291,1,ZD,EQ,1,AND,59,10,CH,LT,C'2010-03-31')
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
smijoss wrote:
hi ,
just wanted to know about the header ($$$)
wont that come into ONLYF1 too. the header of 2nd and 3rd file.
didnt test it .... but i had this i my mind when he had posted this querry
smijoss,
Not really. If you look at the sort card, we are summing on the indicator field at pos 291. So both the header records will be summed together and the total would be a 3 in pos 291 for the header record. The ONLYF1 output file is checking if the indicator value is 1 and hence the header records will NOT be included in the file.
sqlcode1 wrote:
Yes, the headers will fall into ONLYF1. That is everything except what is in OTHER file.
Kolusu,
Thanks for the explanation. I missed the part that while summing indicator we are summing header records as well.
Quote:
Isn't it as sample as this? Cant you just change the INCLUDE to be
Code:
INCLUDE=(291,1,ZD,EQ,1)
My 2 cents for this and I could be wrong again, but by doing this, he would miss records where indicator value is equal to 2.
His OTHER file has records where indicator value is greater than 2(3 or above).
My first impression of this question was that it could be a debug process where OP was trying to find missing records using SAVE.
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
sqlcode1 wrote:
My 2 cents for this and I could be wrong again, but by doing this, he would miss records where indicator value is equal to 2.
His OTHER file has records where indicator value is greater than 2(3 or above).
My first impression of this question was that it could be a debug process where OP was trying to find missing records using SAVE.
Thanks,
oh well OP needs to clarify. I assumed it is a simple file match and OP wants to find out the records which did NOT have a match in the other file. if there are unmatched records from file 2 which OP wants to keep , then he better change the naming conventions of the output file name to something else other than ONLYF1.
If OP wants both unmatched records from file 1 and file 2 then he can use the following control cards and I would retain the indicator at the end so that he can identify the records from which file they came from.
Frank/Kolusu,
I have a question based on the simiar discussion.
Is it possible to use PUSH command with RESTART like SEQNUM? For example, If my input is as shown below and when I am trying to populated field-1 at the end of the record, I would use OVERLAY SEQNUM followed by WHEN=GROUP or in some cases would use temp. file $$$ or HDR.
Code:
Field-1 Field-2
AAAAAA Y
AAAAAA Y
BBBBBB N
CCCCC Y
Is it possible to do it in a single statement as
Code:
INREC PUSH=((81:1,8),RESTART=(1,8))
Please pardon my syntax creation.
Moderators,I am not sure if I should have opened another thread for this question but if you think I should have, please split the topic.