Page 1 of 1

Identify / Extract Upper case records and Lower case records

PostPosted: Tue Jun 07, 2016 3:41 am
by ragsara
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
 

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

PostPosted: Tue Jun 07, 2016 10:11 am
by BillyBoyo
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.

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

PostPosted: Wed Jun 08, 2016 1:01 am
by ragsara
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.

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

PostPosted: Wed Jun 08, 2016 1:25 am
by Robert Sample
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.

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

PostPosted: Wed Jun 08, 2016 2:56 am
by BillyBoyo
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'