in the 20th position i am having the values like
repetedly like in above manner... 'Values' are some other values which are unique
My requirement is, first i want to check for the value '03' at 20th position in the above file(input), if it will find in any record once(means,no need to check for all times if it finds once) then i want to take all the records which is having the value '04' at position 20th to another file(output).
Many thanks to you. its working fine now. actually what i think, this is for my other requirement. so that i posted this as new topic. but still i have doubt on my post 'Filtering records' which is why its not working with 'AND' condition. please tell me the reason and my fault in coding.
but still i have doubt on my post 'Filtering records' which is why its not working with 'AND' condition. please tell me the reason and my fault in coding.
INCLUDE/OMIT conditions work on a individual records. It checks your if your conditions are satisfied on one record at a time. Your case is different as you want to check a previous record value to the next record value which is NOT possible with traditional INCLUDE/OMIT conditions.
i already post a topic regarding this. but it was locked by 'Skolusu'.
Please don't ASSUME. I have got nothing to do with the locking of the topic.
After submitting the job, i got empty output file. if i gave 'OR' instead of 'AND' then i got both records. if we dont have '08' record in input file then also we get '13' record by using 'OR' condition. but i want both records by using 'AND' condition. if we dont have '08' record and have '13' record then i want empty file other wise i want both records in output file.
As I said earlier SORT checks all the include conditions on a single record. When you used OR condition sort checked to see if you had '08' at pos 20 and if it is found it will write out to the output record. Now sort also checks the other include conditions to see if it is valid. If a match is found it is written to the output
When you use an AND condition it is telling sort to check for values of '08' and '20' at pos 20 which is not possible on a single record. Sort cannot apply the include conditions to more than 1 record at a time.
With group functions we treat the first record as a header and push that value to each record that follows and now we can use an include to compare the values as the header value is propagated on to the records that follow.
For complete details on the new WHEN=GROUP function and the other new functions available with PTF UK90013, see: