Query/400: Ignoring Field Case when Selecting Records

The Select Collating Sequence option on Query/400’s Define the Query panel offers an easy and flexible way to specify shared sort sequence, which ensures that mixed-case character fields are sorted without regard for case (i.e., MR. SMITH and Mr. Smith are ranked equally).

First select option 5, “System Sort Sequence,” on the Select Collating Sequence panel. Then select option 3 (Shared) and Language ID: *JOBRUN.

*JOBRUN is resolved at runtime. Query/400 will use this value to select the shared sort table based on the job’s sort sequence (SRTSEQ) and language ID (LANGID).

Using shared sort sequence also lets you ignore case when selecting records based on the value of character fields. Simply open the Specify Processing Options panel and type Y at the “Use collating sequence for all character comparisons” option.

To catch all customers named “smith” regardless of each letter’s case, select customer name “smith” (CUSNAM LIKE ‘%smith%’). This way, “Smith”, “SMITH”, and even “sMitH” will all appear in the report.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s