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
 

 

eliminate the duplicate regardless of case sensitivity

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: eliminate the duplicate regardless of case sensitivity
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: 3158
Location: Tucson AZ

PostPosted: Wed Jun 13, 2007 12:32 am    Post subject:
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    Post subject: eliminate the duplicate regardless of case sensitivity
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

Site Director


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

PostPosted: Wed Jun 13, 2007 3:45 am    Post subject:
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: 3158
Location: Tucson AZ

PostPosted: Wed Jun 13, 2007 4:19 am    Post subject: Spoon Feeding?
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

Site Director


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

PostPosted: Wed Jun 13, 2007 4:35 am    Post subject:
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: 3158
Location: Tucson AZ

PostPosted: Wed Jun 13, 2007 5:00 am    Post subject:
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

Site Director


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

PostPosted: Wed Jun 13, 2007 7:30 am    Post subject:
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    Post subject: solution
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

Site Director


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

PostPosted: Tue Jun 26, 2007 10:00 pm    Post subject:
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    Post subject: duplicates
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: 3158
Location: Tucson AZ

PostPosted: Wed Jun 27, 2007 12:12 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Using ICETOOL, how we can seperate th... bshkris SYNCSORT 5 Tue May 09, 2017 8:33 pm
No new posts VALIDATE NULL VALUE IN DB2 CASE STATE... useit DB2 5 Thu Feb 09, 2017 4:34 pm
No new posts Sort Card to Remove Duplicate records... raj4neo SYNCSORT 2 Wed Jan 25, 2017 4:44 am
No new posts Summing on Mixed Case Literals Roy Ware SYNCSORT 3 Tue Jan 03, 2017 10:18 pm
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm


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