|
View previous topic :: View next topic
|
| Author |
Message |
senthamizh
New User
Joined: 27 Apr 2009 Posts: 23 Location: mumbai
|
|
|
|
Hi,
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.
Thanks,
chez
Code'd |
|
| Back to top |
|
 |
RahulG31
Active User
Joined: 20 Dec 2014 Posts: 446 Location: USA
|
|
|
|
I wonder if you can call them +ve and -ve signs?
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 |
|
| Back to top |
|
 |
Marso
REXX Moderator

Joined: 13 Mar 2006 Posts: 1356 Location: Israel
|
|
|
|
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.
This being said, have you tried:
| Code: |
| INCLUDE COND=(05,16,SS,EQ,C'-') |
|
|
| Back to top |
|
 |
senthamizh
New User
Joined: 27 Apr 2009 Posts: 23 Location: mumbai
|
|
|
|
Thanks all. I try INCLUDE COND=(05,16,SS,EQ,C'-').I tested with sample records it worked. Will try in the job and test it.Thank you very much.
Thanks,
Chez |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|