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
 

 

Sorting depending on Alphbets and numbers

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
Mazahar

New User


Joined: 11 Dec 2007
Posts: 82
Location: hyderabad

PostPosted: Wed May 20, 2009 2:27 pm    Post subject: Sorting depending on Alphbets and numbers
Reply with quote

Hi All,

Can any one assist me here please

i have lakhs of records like this in a 15 byte FB file

A12345
B12345
C12345
D12345
AA1234
AB1234
AC1234
AD1234

I want to get the records which are having second byte as character in a output file.

AA1234
AB1234
AC1234
AD1234

I know wo options

1) include condition with EQ for 26 characters
2) include condition with NE for 0 to 9

other thans this any other way?
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Wed May 20, 2009 2:53 pm    Post subject:
Reply with quote

try this
Code:

 INCLUDE COND=(2,1,CH,GE,C'A',AND,2,1,CH,LE,C'Z')
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Wed May 20, 2009 4:41 pm    Post subject:
Reply with quote

Hi,

does byte 2 of the input data only contain the 26 letters of the alphabet and numbers 0-9.

The reason I'm asking is that are other values between A thru Z.


Gerry
Back to top
View user's profile Send private message
Mazahar

New User


Joined: 11 Dec 2007
Posts: 82
Location: hyderabad

PostPosted: Wed May 20, 2009 7:07 pm    Post subject: Expat
Reply with quote

Expat,

It Worked thanks

Gcicchet,

Yes It may contain Alphabets as well numbers, but i need only the records which are having 2 byte as alphabets.

Expat solution worked for me.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Wed May 20, 2009 8:42 pm    Post subject:
Reply with quote

This simpler DFSORT INCLUDE statement would work too:

Code:

  INCLUDE COND=(2,1,FS,NE,NUM)   
Back to top
View user's profile Send private message
Mazahar

New User


Joined: 11 Dec 2007
Posts: 82
Location: hyderabad

PostPosted: Wed May 20, 2009 10:47 pm    Post subject:
Reply with quote

Frank,

Can you please tell me What is FS in u r statement?
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Wed May 20, 2009 11:06 pm    Post subject:
Reply with quote

FS with NUM means to interpret NUM as meaning the characters '0'-'9'. You can also use ZD and PD with NUM, when appropriate.

For more information on DFSORT's NUM function, see:

http://www.ibm.com/systems/support/storage/software/sort/mvs/peug/
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Thu May 21, 2009 3:17 am    Post subject:
Reply with quote

Frank's solution is most likely the best, but if you used expat's taking into account Gerry's post, you could split up the A-Z range into 3 ranges of A-I, J-R, and S-Z to eliminate those "extra" characters.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Thu May 21, 2009 3:42 am    Post subject:
Reply with quote

Note that the NUM solution actually includes anything other than '0'-'9'. If only 'A'-'Z' is to be included, then the NUM solution won't work. Guess it depends on what Mazhar means by "Alphabets" - I took it to mean any non-numeric, not just 'A'-'Z'.
Back to top
View user's profile Send private message
Mazahar

New User


Joined: 11 Dec 2007
Posts: 82
Location: hyderabad

PostPosted: Sat May 23, 2009 12:44 pm    Post subject:
Reply with quote

thanks to all
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Sat May 23, 2009 7:53 pm    Post subject:
Reply with quote

Frank Yaeger wrote:
Note that the NUM solution actually includes anything other than '0'-'9'. If only 'A'-'Z' is to be included, then the NUM solution won't work. Guess it depends on what Mazhar means by "Alphabets" - I took it to mean any non-numeric, not just 'A'-'Z'.

The COBOL definition of the ALPHABETIC class is A-Z and space.
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Sorting of hex values Saurabh_mi DFSORT/ICETOOL 11 Thu May 25, 2017 3:49 pm
No new posts Sorting group data rajella DFSORT/ICETOOL 4 Sun Jan 22, 2017 11:32 pm
No new posts Incorrect output when trying to add n... monica1 PL/I & Assembler 10 Fri Jan 13, 2017 5:02 pm
No new posts Efficient sorting chandracdac DFSORT/ICETOOL 5 Sat Oct 22, 2016 3:23 am
No new posts Row-Numbers of distinct rows? Auryn DB2 1 Thu Oct 20, 2016 4:38 pm


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