|
View previous topic :: View next topic
|
| Author |
Message |
cpuhawg
Active User

Joined: 14 Jun 2006 Posts: 331 Location: Jacksonville, FL
|
|
|
|
I am selecting against a FB/3051 dataset using DFSORT. When I select records with JOHNSON somewhere in positions 141-340, I get 4 records.
| Code: |
SORT FIELDS=COPY
INCLUDE COND=(141,200,SS,EQ,C'JOHNSON')
|
When I select records with Johnson somewhere in positions 141-340, I get 247 records.
| Code: |
SORT FIELDS=COPY
INCLUDE COND=(141,200,SS,EQ,C'Johnson')
|
Are there any parameters I can use with DFSORT, so if I select JOHNSON, I will select all Johnsons from the file, regardless of case? |
|
| Back to top |
|
 |
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
You could use an OR on your INCLUDE. It won't get you "JoHnson" unless you code for that as well.
There is TRAN. With TRAN you can covert a field in various ways, including UTOL (upper to lower) and LTOU (lower to upper). This would deal with all possible "mangled-case" versions of Johnson.
Of course, you may not want to do that to your actual field, so you can "extend" your record by appending 141,200 at column 3052 with OVERLAY, doing the TRAN while you are at it, then INCLUDE with the all-upper or all-lower (your choice) on the exteded field, and drop the appended data before writing out, INREC BUILD=(1,3051) for instance. |
|
| Back to top |
|
 |
cpuhawg
Active User

Joined: 14 Jun 2006 Posts: 331 Location: Jacksonville, FL
|
|
|
|
Thank you very much. I didn't want the field changed on the output. I just wanted to select all records with Johnson, regardless of case. DFSORT should probably have a prefix or keywork parameter to accomplish this.
I will probably switch the utility to FILEAID that can select upper and lower case by simply inserting a 'T' prefix.
$$DD01 COPY IF=(141,200,T'Johnson') |
|
| Back to top |
|
 |
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Well, I've outlined how to do it without changing the output record :-)
I'm sure Kolusu will take your suggestion on board, and he will probably suggest a better way to do what you want than I have. |
|
| Back to top |
|
 |
dick scherrer
Moderator Emeritus

Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
| Quote: |
| I didn't want the field changed on the output. |
Just to re-iterate what Bill said.
If you do as suggested, the selection will be as you want, but the output will have the original values - unchanged. |
|
| Back to top |
|
 |
|
|