Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Summing on Mixed Case Literals

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> SYNCSORT
View previous topic :: :: View next topic  
Author Message
Roy Ware

New User


Joined: 19 Sep 2013
Posts: 14
Location: USA

PostPosted: Tue Jan 03, 2017 10:18 pm    Post subject: Summing on Mixed Case Literals
Reply with quote

I'm being held hostage by two database tables who refuse to compromise. One table has the City Name in Mixed Case letters: El Paso, for example. The second has the City Name in Uppercase letters: EL PASO.

The goal is to summarize the dollar amount field for each city, regardless of the case, with the mixed case being the desirable output, but showing the uppercase name in case a "matching" lowercase is not available.

Here's the data:
Code:
Mattoon                277.86
MATTOON                179.02
Charleston             801.13
POPLAR GROVE           354.03


The desired output is:
Code:
Mattoon                 456.88
Charleston              801.13
POPLAR GROVE            354.03


Of course, nothing like this has been attempted here before, so there aren't any examples and the SyncSort manual isn't much help. Any suggestions?
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10365
Location: italy

PostPosted: Tue Jan 03, 2017 10:26 pm    Post subject: Reply to: Summing on Mixed Case Literals
Reply with quote

just overlay/build an additional field with the content of the key upper/lower cased for matching
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7314

PostPosted: Tue Jan 03, 2017 10:54 pm    Post subject: Reply to: Summing on Mixed Case Literals
Reply with quote

As enrico said, "normalise" the name in a temporary extension. SORT on that name. You'll also need to discriminate between upper/mixed, so that you can favour the mixed when both are present (a second field to include an indicator for mixed/upper so you can "outsort" the upper).

Exactly how you do that depends on the quality of your data. If you can have embedded typos...?

Whether SyncSort has TRAN= or some other built-in way to convert case is another issue.
Back to top
View user's profile Send private message
Roy Ware

New User


Joined: 19 Sep 2013
Posts: 14
Location: USA

PostPosted: Tue Jan 03, 2017 11:40 pm    Post subject:
Reply with quote

Yes, the field can have embedded typos - why can't we hold the front-ends to the same standards we have to match? - but Enrico's suggestion is going to work great!
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 -> SYNCSORT All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts RFE: DB2 support for mixed case names. Pedro DB2 0 Tue Jul 04, 2017 1:32 am
No new posts VALIDATE NULL VALUE IN DB2 CASE STATE... useit DB2 5 Thu Feb 09, 2017 4:34 pm
No new posts A not very Christmassy PL/I tale, wit... prino PL/I & Assembler 3 Mon Dec 26, 2016 1:01 am
No new posts Consolidating and summing file contents Kevin Lindsley SYNCSORT 14 Thu Jun 09, 2016 5:24 am
No new posts Case insenstive in INCLUDE Condtion smileseenu DFSORT/ICETOOL 2 Mon Feb 15, 2016 8:42 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us