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 to include numeric data only

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

New User


Joined: 04 Jun 2010
Posts: 25
Location: Pune

PostPosted: Thu Jul 01, 2010 4:22 pm    Post subject: SORT to include numeric data only
Reply with quote

Hi ,
I have an input PS : having the following details

Code:
011D                                 M  ABC
011D                                 M  DEF
011D                                 M  124


I need to retrevie only the third record as it has numeric input at '124' but the copybook declaration for the field is characters. Can we write a sort to retreive only records consisting of numeric data at the position mentioned ?
I used the below sort but it did not serve the purpose icon_sad.gif
SORT FIELDS=COPY
INCLUDE COND=(46,3,FS,EQ,NUM)
Please guide me on this icon_sad.gif
Back to top
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Jul 01, 2010 5:47 pm    Post subject:
Reply with quote

Quote:
I used the below sort but it did not serve the purpose


does not really help- explains nothing.

are you sure that 46 for 3 is the correct positioning?
according to your layout, it is 41 for 3.
is the file fixed or variable length?
if it is var, then it would be 45 for 3. +4 for the RDW
Back to top
View user's profile Send private message
RedDevil711

New User


Joined: 04 Jun 2010
Posts: 25
Location: Pune

PostPosted: Thu Jul 01, 2010 5:58 pm    Post subject:
Reply with quote

It is 41,3 only
i calculated incorrectly ,
Also it is a fixed length file only
I used the following combination of sort too :

SORT FIELDS=COPY
INCLUDE COND=(41,3,CH,GE,C'000',AND,41,3,CH,LE,C'999')
Back to top
View user's profile Send private message
Garry Carroll

Active Member


Joined: 08 May 2006
Posts: 991
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Thu Jul 01, 2010 6:29 pm    Post subject:
Reply with quote

I got this working with

Code:
  OPTION COPY                                         
  INCLUDE COND=(41,3,CH,GE,C'000',AND,41,3,CH,LE,C'999')


are you sure of your field alignment?

Garry.
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Thu Jul 01, 2010 6:37 pm    Post subject: Reply to: SORT to include numeric data only
Reply with quote

Well, all I can say is that:

Code:

  OPTION COPY
  INCLUDE COND=(41,3,FS,EQ,NUM)


did work for me as expected.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10211
Location: italy

PostPosted: Thu Jul 01, 2010 6:51 pm    Post subject: Reply to: SORT to include numeric data only
Reply with quote

Code:
INCLUDE COND=(41,3,CH,GE,C'000',AND,41,3,CH,LE,C'999')


with that condition something like '0AB' would pass,
remember ... '000' < '0AB' < '999'

using this approach You should check each column
(41,1,CH,GE,C'0',AND,41,1,CH,LE,C'9',AND,42,1,CH,GE,C'0',AND,42,1,CH,LE,C'9',AND,43,1,CH,GE,C'0',AND,43,1,CH,LE,C'9')

my post does not relate to the best way of solving the issue with sort,
just points out a logic flaw icon_biggrin.gif
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 Storing huge volume of data, compare ... Pradeep K M All Other Mainframe Topics 3 Mon Jan 16, 2017 5:08 pm
No new posts how to recover an uncataloged VSAM da... archanamuthukrishnan All Other Mainframe Topics 3 Wed Jan 11, 2017 6:18 pm
No new posts HALDB data refresh/copy from producti... vineetanand2007 IMS DB/DC 1 Mon Jan 02, 2017 11:16 am
No new posts JES2 JEC: Use UNIX Pipes to Pass Data... Virendra Shambharkar JCL & VSAM 21 Tue Dec 20, 2016 6:55 pm
No new posts Is the 'prompt' data for the DSLIST p... Willy Jensen TSO/ISPF 2 Tue Dec 06, 2016 4:38 am


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