Identify / Extract Upper case records and Lower case records



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

Identify / Extract Upper case records and Lower case records

Postby ragsara » Tue Jun 07, 2016 3:41 am

Hi ,

Can someone please help me out in identifying Upper case records and lower case records(First Byte need not be considered) using SORT functionality in JCL, write them into separate output files.

Field length = 20 Bytes


INPUTFILE
PISZCZEK
Steinman
Favela  
Cruz    
Parker  
Grass  
Nielsen
HOGAN
 



OUTPUTFILE1
PISZCZEK
HOGAN
 



OUTPUTFILE2
Steinman
Favela  
Cruz    
Parker  
Grass  
Nielsen
 
ragsara
 
Posts: 23
Joined: Thu Mar 22, 2012 5:17 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Identify / Extract Upper case records and Lower case rec

Postby BillyBoyo » Tue Jun 07, 2016 10:11 am

Look at the index of your manual for your SORT product. Give it a go.

If you get stuck, post what you've tried, and we can help.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Identify / Extract Upper case records and Lower case rec

Postby ragsara » Wed Jun 08, 2016 1:01 am

Hi Billy,

I have used the below approach,


//SYSIN DD *                      
 SORT FIELDS=COPY                  
 INCLUDE COND=((2,1,CH,EQ,C'a'),OR,
               (2,1,CH,EQ,C'b'),OR,
               (2,1,CH,EQ,C'c'),OR,
               (2,1,CH,EQ,C'd'),OR,
               (2,1,CH,EQ,C'e'),OR,
               (2,1,CH,EQ,C'f'),OR,
               (2,1,CH,EQ,C'g'),OR,
               (2,1,CH,EQ,C'h'),OR,
               (2,1,CH,EQ,C'i'),OR,
               (2,1,CH,EQ,C'j'),OR,
               (2,1,CH,EQ,C'k'),OR,
               (2,1,CH,EQ,C'l'),OR,
               (2,1,CH,EQ,C'm'),OR,
               (2,1,CH,EQ,C'n'),OR,
               (2,1,CH,EQ,C'o'),OR,
               (2,1,CH,EQ,C'p'),OR,
               (2,1,CH,EQ,C'q'),OR,
               (2,1,CH,EQ,C'r'),OR,
               (2,1,CH,EQ,C's'),OR,
               (2,1,CH,EQ,C't'),OR,
               (2,1,CH,EQ,C'u'),OR,
               (2,1,CH,EQ,C'v'),OR,
               (2,1,CH,EQ,C'w'),OR,
               (2,1,CH,EQ,C'x'),OR,
               (2,1,CH,EQ,C'y'),OR,
               (2,1,CH,EQ,C'z'))
 


But I know this is not a comprehensive one, and there are 18 more characters left to be checked, which will involve a lot of 'OR' conditions. So I was checking if we have any specific functions in DFSORT to differentiate between uppercase and lowercase characters.

Thanks for taking your time to reply to my post.
ragsara
 
Posts: 23
Joined: Thu Mar 22, 2012 5:17 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Identify / Extract Upper case records and Lower case rec

Postby Robert Sample » Wed Jun 08, 2016 1:25 am

Do you know that each record only has lower case / upper case after the first byte? If you do know so, why check every character? You can just compare the 2nd byte to 'A' -- if it is GE, you've got an upper case record and if not you've got a lower case record.
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: Identify / Extract Upper case records and Lower case rec

Postby BillyBoyo » Wed Jun 08, 2016 2:56 am

Since z/OS Version 2 Release 1 of DFSORT, new alphanumeric comparison tests are available.

Robert's suggestion is a good one. Just look at the first relevant byte. Use the data-type if available, otherwise the GT,C'A'
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post