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

eliminate the duplicate regardless of case sensitivity


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
p_gandhi

New User


Joined: 20 Apr 2007
Posts: 14
Location: TORONTO,ONTARIO,CANADA

PostPosted: Wed Jun 13, 2007 12:27 am
Reply with quote

Hi,
My requirement just change to no more case sensitivity when I am comparing the two records from the same file.

Example:

if Paresh = PARESH this is not called the duplicate
now question is my file contain duplicates with lower case and upper case.
What should I do to eliminate duplicates like this?

How do I convert all the required filed to upper or lower case?

it's one file
multiple duplicates
multiple different cases for the same keys

Please help me to solve this problem

Paresh
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Wed Jun 13, 2007 12:32 am
Reply with quote

Enterprise COBOL has both UPPER-CASE and LOWER-CASE intrinsic functions, can you use them.
Back to top
View user's profile Send private message
p_gandhi

New User


Joined: 20 Apr 2007
Posts: 14
Location: TORONTO,ONTARIO,CANADA

PostPosted: Wed Jun 13, 2007 1:12 am
Reply with quote

can you be more specific I found one case where I can change cases
example:
*** PLEASE DO NOT CHANGE THE CASE FOR THE 88 LEVEL CONDITION:
*** WS-LOWER-CASE.
05 WS-CASE.
10 WS-LOWER-CASE PIC X(26)
VALUE 'abcdefghijklmnopqrstuvwxyz'.
10 WS-UPPER-CASE PIC X(26)
VALUE 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.

**********
**--------------------------------------------------------------**
** CONVERT ANY LOWER CASE CHARACTERS TO UPPER CASE **
** **
**--------------------------------------------------------------**
**
IF C8X53899-SDS-NAME-FORMAT1 IS ALPHABETIC-UPPER
NEXT SENTENCE
ELSE
INSPECT C8X53899-SDS-NAME-FORMAT1
CONVERTING WS-LOWER-CASE TO WS-UPPER-CASE
END-IF.

INSPECT C8X53899-SDS-ADDRESS
CONVERTING WS-LOWER-CASE TO WS-UPPER-CASE.

************
This is what I found if yours is different then this please write it here so I'll find which one is better

thanks for your quick reply
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Jun 13, 2007 3:45 am
Reply with quote

Hello,

Please start over and post examples of your requirement - not just one that does not appear to follow the "rules".
Quote:
My requirement just change to no more case sensitivity when I am comparing the two records from the same file.

Example:

if Paresh = PARESH this is not called the duplicate
now question is my file contain duplicates with lower case and upper case.
What should I do to eliminate duplicates like this?

is quite unclear. In the last 3 lines you say it "is not called the duplicate" and then ask how "to eliminate duplicates like this".

Post several sets of data and whether they should or should not be considered duplicates. Once we know what you are trying to do, we can offer suggestions.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Wed Jun 13, 2007 4:19 am
Reply with quote

If you have Enterprise COBOL, it has your solution.
Look at the intrinsic functions UPPER-CASE and LOWER-CASE.
If function upper-case(Paresh) = function upper-case(PARESH) is a duplicate.
If function upper-case(ParEsh) = function upper-case(PArEsH) is a duplicate.
Do you understand?
Do you have Enterprise COBOL?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Jun 13, 2007 4:35 am
Reply with quote

Hi Bill,

I'm confused on what the requirement actually is.

From above, the "rules" say that different case is not a duplicate, then later call them a duplicate.

I imagine we can offer alternatives once we're given the rules - or possibly your method is exactly what is required.

I dunno - long week today. . . icon_confused.gif
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Wed Jun 13, 2007 5:00 am
Reply with quote

Hi Dick,

I read that his original requirements were case sensitive but now that has changed (like we've never seen that?) and now case needs to be ignored....

If He has the functions, it's a no-brainer....

If he doesn't, now, that will be an interesting programming task....

Eleven and a half today.....
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Jun 13, 2007 7:30 am
Reply with quote

An array with an INSPECT converting from lower to upper case might do it . . .
Back to top
View user's profile Send private message
p_gandhi

New User


Joined: 20 Apr 2007
Posts: 14
Location: TORONTO,ONTARIO,CANADA

PostPosted: Tue Jun 26, 2007 8:14 pm
Reply with quote

Hi,
thanks to all for helping, find the way to resolved this situation.

1st) I use sort routine to change lowecase to uppercase all the records
and bring those upper case record in front of the file
Code:

Code:

//SYSIN    DD  *                     
   SORT FIELDS=COPY                 
   OUTFIL CONVERT,                   
    OUTREC=(1:16,30,TRAN=LTOU,       
            31:47,10,TRAN=LTOU,     
            41:57,20,TRAN=LTOU,     
            61:77,20,TRAN=LTOU,     
            81:97,25,TRAN=LTOU,     
            106:122,10,TRAN=LTOU,   
            116:132,20,TRAN=LTOU,   
              5,245)                 


My file length was 245 that become 380 becasue whatever I did LtoU
I created seprate field.
then I sort again to sort on uppercase fields to bring data sorted properly

Code:

//SYSIN    DD  *           
   SORT FIELDS=(136,7,PD,A,
                143,2,PD,A,
                1,30,CH,A, 
                289,26,CH,A,
                41,60,CH,A,
                61,80,CH,A,
                81,105,CH,A)


In my program where I need charecter to compare I use as reference my new uppercase fields.

Still not clear please don't hesitate to ask
Paresh Gandhi
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Jun 26, 2007 10:00 pm
Reply with quote

Thank you for posting your solution icon_smile.gif
Back to top
View user's profile Send private message
p_gandhi

New User


Joined: 20 Apr 2007
Posts: 14
Location: TORONTO,ONTARIO,CANADA

PostPosted: Tue Jun 26, 2007 10:54 pm
Reply with quote

Yes, This is working and it's in QA testing

thanks
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Wed Jun 27, 2007 12:12 am
Reply with quote

Next time you are looking for a sort solution, try mentioning that earlier.
Posting your question in the COBOL forum tends to let people jump to the conclusion that you want a COBOL solution.
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts Duplicate transid's declared using CEDA CICS 3
No new posts Duplicate several members of/in one l... JCL & VSAM 7
No new posts Newbie Stuck on "Duplicate Datas... TSO/ISPF 5
No new posts Zunit Test case editor error Testing & Performance 4
Search our Forums:

Back to Top