Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Sort Numeric

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
senthamizh

New User


Joined: 27 Apr 2009
Posts: 22
Location: mumbai

PostPosted: Tue Apr 21, 2015 8:55 am    Post subject: Sort Numeric
Reply with quote

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
View user's profile Send private message

RahulG31

Active User


Joined: 20 Dec 2014
Posts: 375
Location: USA

PostPosted: Tue Apr 21, 2015 10:22 am    Post subject: Reply to: Sort Numeric
Reply with quote

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
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1230
Location: Israel

PostPosted: Tue Apr 21, 2015 2:29 pm    Post subject:
Reply with quote

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
View user's profile Send private message
senthamizh

New User


Joined: 27 Apr 2009
Posts: 22
Location: mumbai

PostPosted: Tue Apr 21, 2015 5:06 pm    Post subject: Reply to: Sort Numeric
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Validate if a Value from the file is ... balacsv2 COBOL Programming 8 Mon Jun 19, 2017 11:52 pm
No new posts Reduce CPU Times for Join Sort santoshn SYNCSORT 12 Sat Jun 10, 2017 1:40 pm
No new posts Db2 load job abending in SORT mistah kurtz DB2 4 Mon Jun 05, 2017 3:58 pm
No new posts How to change 'K' or 'M' use Sort vice_versa DFSORT/ICETOOL 5 Thu May 18, 2017 7:11 am
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us