Requirement is to exclude the record when Field-1 contains the value 1,00,000.00. Here 1st record has value 1,00,000.00, 2nd record has value 1,00,000.11.
But when i use the condition INCLUDE COND=(1,10,PD,NE,+100000.00)
i am getting both two records in the ouput. I want only the 2nd record as ouput.
You should realize that SORT will not be concerned/understand the decimal positions and will treat everything as integer numbers
so ( forgive my cobol approximation, I am not that fluent in COBOL )
if You have a packed variable with two decimals 999.99 it will be stored in three bytes and from the sort point of view You should consider it as a <unorthodox> integer with no decimal
if COBOL understands the value as 123.45 SORT will understand just 12345 !
so just drop the decimals and carry on all the decimal point elucubrations Yourself
PS.
just tested with DFSORT ,
using INCLUDE COND=(1,10,PD,NE,+100000.00)
gives a return code 16, comparison field error under the decimal point,
something has not been told here
Bill, the sign does not make any difference, I just tested with both x'c' and x'f' signs and with a +xxx and xxx value,
the result does not change ( the output is correct )
what I do not understand, as i said , is how the TS can complain about bad output when the sort would never work as written!
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
That should do nicely enrico. Subject to the signs, which I have not much idea about in SORTs, but I think generally they are not bothered until it comes to 'rithmatic and a couple of other things.
A Note: INCLUDE with NE is equivalent to OMIT with EQ. To me the latter is clearer.
R Karthik, if you are, or will, using, or use, that layout for that data in a Cobol program, you are asking for trouble (potentially, not guaranteed - yet).
When i changed the condition to
INCLUDE COND=(1,10,PD,NE,+10000000), it omits the records with value 1,00,000.00. I will make sure the layout while using in COBOL.
I have added "if COBOL understands the value as 123.45 SORT will understand just 12345 ! " to my lessons learnt list.