Need only numeric records using dfsort commands



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Need only numeric records using dfsort commands

Postby bhaki14 » Wed Jan 19, 2011 12:42 pm

Hi ,

In my file, there are 100 records.
In those, 50 are alphanumeric and 50 are numeric.
Here, i need only numeric ones using dfsort commands.
So, how would i do it ?
Suggestions are appreciated.


Thanks,
Bhanu.
bhaki14
 
Posts: 2
Joined: Wed Jan 19, 2011 12:31 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Suggesstions need

Postby NicC » Wed Jan 19, 2011 3:20 pm

have you checked out any of the sort documentation - links are in other posts within this section. I believe someone asked this sort of question a week or so ago - suggest you search through, as you should already have done, and see if you can find the post.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Suggesstions need

Postby Frank Yaeger » Thu Jan 20, 2011 12:06 am

Bhanu,

You need to give more information about what exactly you're trying to do.

What is the RECFM and LRECL of the input file?

What is the starting position and length of the field that can be numeric or alphanumeric?

Does numeric mean it only has characters 0-9, whereas alphanumeric has anything else?

Please show an example of the records in your input file and what you expect for output.
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times

Re: Need only numeric records using dfsort commands

Postby bhaki14 » Fri Jan 21, 2011 7:56 am

Hey, thanks for the reply.

RECFM : FB
LREC : 100
All parameters are same for both input and output datasets.

//sysin dd *
sort fields=copy
include=(100,1,ch,eq,c' y ')
outrec fields=(1,3,97x)

Through the above conditions, i got like this.

aed
juk
456
trf
uji
987
eer
yji
kki
338
259
kop

Now my requirement is, i want only the numeric records in my output dataset.
Or else, numeric records in one dataset and alphanumeric in another dataset.
bhaki14
 
Posts: 2
Joined: Wed Jan 19, 2011 12:31 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Need only numeric records using dfsort commands

Postby Frank Yaeger » Fri Jan 21, 2011 11:09 pm

I asked
What is the starting position and length of the field that can be numeric or alphanumeric?


You didn't give me that information.

You show an INCLUDE with 100,1 which would imply that the field starts at position 100, but you show an example which implies that the field is in positions 1-3. It would be much easier to help you if you gave complete and clear information (especially when asked).

At any rate, you can select fields with only numerics using DFSORT's NUM function, e.g.

    INCLUDE COND=(1,3,FS,EQ,NUM)


For more information, see the "Check for a numeric string" Smart DFSORT Trick at:

http://www.ibm.com/support/docview.wss? ... g3T7000094
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post