PxPlus User Forum

Twitter Twitter Twitter

Author Topic: ** DISEGARD ** -> Mixed Case in Keys  (Read 1588 times)

Jeffrey Ferreira

  • Diamond Member
  • *****
  • Posts: 178
  • I must have taken a wrong turn at Albuquerque.
    • View Profile
** DISEGARD ** -> Mixed Case in Keys
« on: August 03, 2023, 12:07:07 PM »
Hi List,
i was about to embark on a project for a client and i figured i better confirm the following before i begin.

we have an index -> The Customer's PO Number
sometimes it comes in Mixed Case .......

my question is -> are Keys always case sensitive...
i'm pretty sure the answer is yes but i dont want to start this workaround unless i'm 100% sure....i just want to make sure there is no cool feature in pxplus that i'm unaware of

thanks

jeff
« Last Edit: August 03, 2023, 12:17:28 PM by Jeffrey Ferreira »

Jeffrey Ferreira

  • Diamond Member
  • *****
  • Posts: 178
  • I must have taken a wrong turn at Albuquerque.
    • View Profile
Re: Mixed Case in Keys
« Reply #1 on: August 03, 2023, 12:17:05 PM »
Never mind. I just realized something. Even if there was a feature that forced the key to uppercase (while data remained mixed), I would still have to change all my code to force what i'm reading with to uppercase. Please disregard...sorry

Loren Doornek

  • Gold Member
  • ****
  • Posts: 85
    • View Profile
Re: ** DISEGARD ** -> Mixed Case in Keys
« Reply #2 on: August 03, 2023, 12:21:51 PM »
You could probably use I/O logic on the data file to read using uppercase.  Then, you wouldn't need to change all of the reads in various programs.

Jane Raymond

  • Staff
  • Diamond Member
  • *****
  • Posts: 280
    • View Profile
    • PVX Plus Technologies
Re: ** DISEGARD ** -> Mixed Case in Keys
« Reply #3 on: August 03, 2023, 01:53:28 PM »
When you define keys for a file, you can define options for individual segments, such as case sensitivity. So if you define a key segment as uppercase, the key value will be uppercase but the field within the data would still be mixed when you read the data in the record. You could get the uppercase value using KEC(chan,kno), or by using UCS() on the field.
Jane Raymond
Software Developer
PVX Plus Technologies Ltd.

Jane Raymond

  • Staff
  • Diamond Member
  • *****
  • Posts: 280
    • View Profile
    • PVX Plus Technologies
Re: ** DISEGARD ** -> Mixed Case in Keys
« Reply #4 on: August 03, 2023, 02:03:22 PM »
I forgot to mention, if a key segment is defined as uppercase, for example, you can use a mixed case key value when reading by key and it will still find it,
Jane Raymond
Software Developer
PVX Plus Technologies Ltd.

Jeffrey Ferreira

  • Diamond Member
  • *****
  • Posts: 178
  • I must have taken a wrong turn at Albuquerque.
    • View Profile
Re: ** DISEGARD ** -> Mixed Case in Keys
« Reply #5 on: August 03, 2023, 02:12:22 PM »
Hi Jane,

That is really interesting:

"if a key segment is defined as uppercase, for example, you can use a mixed case key value when reading by key and it will still find it"

Thank you.  I will chat with some folks at our office.

jeff

Mike King

  • Diamond Member
  • *****
  • Posts: 3818
  • Mike King
    • View Profile
    • BBSysco Consulting
Re: ** DISEGARD ** -> Mixed Case in Keys
« Reply #6 on: August 08, 2023, 11:38:16 AM »
As a follow up ---  When we store records on a keyed file the system builds a table of keys with pointers to the actual record.  The key table consists of the key field(s) extracted from the record data, so when you declare that a key is Uppercase (or Lowercase / Accented) the actual key value stored in the table is converted but not value in the record itself. 

This holds true for numeric fields where we extract the numeric value from the record and convert it into an internal representation such that the lowest negative numbers occur first followed by zero and then the positive numbers.
Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com