IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Sort Numeric


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
senthamizh

New User


Joined: 27 Apr 2009
Posts: 23
Location: mumbai

PostPosted: Tue Apr 21, 2015 8:55 am
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: 446
Location: USA

PostPosted: Tue Apr 21, 2015 10:22 am
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: 1353
Location: Israel

PostPosted: Tue Apr 21, 2015 2:29 pm
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: 23
Location: mumbai

PostPosted: Tue Apr 21, 2015 5:06 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 8
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts how to calculate SUM value for VB fil... DFSORT/ICETOOL 1
No new posts how to calculate SUM for VB file usin... JCL & VSAM 1
Search our Forums:

Back to Top