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

Sorting depending on Alphbets and numbers


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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: 8797
Location: Welsh Wales

PostPosted: Wed May 20, 2009 2:53 pm
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: 1702
Location: Australia

PostPosted: Wed May 20, 2009 4:41 pm
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
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 Developer


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

PostPosted: Wed May 20, 2009 8:42 pm
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
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 Developer


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

PostPosted: Wed May 20, 2009 11:06 pm
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:

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
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 Developer


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

PostPosted: Thu May 21, 2009 3:42 am
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Generate random number from range of ... COBOL Programming 3
This topic is locked: you cannot edit posts or make replies. Automation need help in sorting the data DFSORT/ICETOOL 38
No new posts How can I select certain file dependi... JCL & VSAM 12
This topic is locked: you cannot edit posts or make replies. How can I select certain file dependi... Compuware & Other Tools 1
Search our Forums:

Back to Top