Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
Hi all,
I have an input file.my requirement is to validate certain fields whether it is numeric or not.
I know that this is possible using DFSORT's INCLUDE COND=(1,6,FS,EQ,NUM).
Is it possible using SYNCSORT/SYNCTOOL??.
Joined: 25 Jun 2007 Posts: 196 Location: Bangalore
Aaru,
In your code you are checking for value greater than 'Z' i.e., X'E9'.
Greater than X'E9' are X'EA', X'EB', X'EC', X'ED', X'EE', X'EF', X'F0', X'F1', X'F2', X'F3', X'F4', X'F5', X'F6', X'F7', X'F8', X'F9', X'FA', X'FB', X'FC', X'FD', X'FE' and X'FF'.
But numeric values are from X'F0', X'F1', X'F2', X'F3', X'F4', X'F5', X'F6', X'F7', X'F8' and X'F9'.
Suppose if the fields contain the values X'EA', X'EB', X'EC', X'ED', X'EE', X'EF', X'FA', X'FB', X'FC', X'FD', X'FE' and X'FF', the output will be wrong.
Please correct me if i am wrong.
arcvns,
Please check with the following code for your requirement.
Code:
INCLUDE COND=(1,1,SS,EQ,C'0123456789',AND,
2,1,SS,EQ,C'0123456789',AND
3,1,SS,EQ,C'0123456789',AND
4,1,SS,EQ,C'0123456789',AND
5,1,SS,EQ,C'0123456789',AND
6,1,SS,EQ,C'0123456789')
Joined: 07 Jun 2010 Posts: 59 Location: coimbatore
In the below code,
how to check numeric value for two positions,
Say i have to check numeric value from 1-6 and 10-16.
if so how to modify the below code...
Please advise.
but this condition works when both the positions have non-numeric value.
My question is if anyone of the position (either 1-6 or 10-16) has non-numeric value then i have to skip the record. How to achive this..?
With the syncsort 1.3 Version or above you will be able to achieve the output with the same code you used for DFSORT
Code:
SORT FIELDS=COPY
INCLUDE COND=(1,9,FS,EQ,NUM)
If you check the latest manual you will find the below enhancement
Quote:
Other Enhancements
• INCLUDE/OMIT Control Statement
• The NUM subparameter has been added. NUM determines if a field is numeric or
non-numeric in CSF/FS, PD, or ZD format.