I have to omit the nonnumeric records from the input file. Below is the sample input and sort cond i am using.
1/p:
Code:
----+----1----+----2-
*********************
AB 00000-350000
XX 000004363500
34 000001010000
VS 00000-128800
DS 00000-29167
12 000005679899
Code:
sort cond = OMIT=(05,16,ZD,NE,NUM)
the cobol layout for the fields is defines as PIC 9(12)V9999.This filed is Zoned Decimel.
When i use this omit cond i am able to omit non numeric records.But now i want to omit only the records with +ve sign from the input records.I dont want to omit the -ve signed nonnumeric records form the input file.
the out put should be,
Code:
----+----1----+----2-
*********************
AB 00000-350000
VS 00000-128800
DS 00000-29167
could some one help me on this.what will be SORT COND i can use.
I would call it as a dash/hyphen '-' present in the data and would compare it with that. If the position is fixed then it's better but if not then you have to write multiple compare statements for each column from column 5 to 16.
something like: INCLUDE=(5,16,FS,NE,NUM),AND,(5,1,CH,EQ,C'-') and so on for other columns from 6-16
First of all, you have to be consistent with your example:
* You say the "numeric" field is 16 chars long, yet your example has only 12 chars.
* This is not a valid sort command. Why not just give the original statement ?
Quote:
Code:
sort cond = OMIT=(05,16,ZD,NE,NUM)
* I haven't seen any records with a "+ve" sign in your example.