View previous topic :: View next topic
|
Author |
Message |
Shah
New User
Joined: 05 Sep 2006 Posts: 18
|
|
|
|
Hi All,
In a file, I have 'AAAA' which processing through Cobol program. Here I have to change it to 'aaaa' to find the value in DB2 tables
Help needed,
Thanks in Advance,
Shah |
|
Back to top |
|
|
DavidatK
Active Member
Joined: 22 Nov 2005 Posts: 700 Location: Troy, Michigan USA
|
|
|
|
Shaik
There are a few ways of handling this:
Case 1:
Code: |
SELECT --
FROM DB2.?
WHERE UCASE(DB2_COLUMN) = :WS-COBOL-VARIABLE
|
CASE 2:
Code: |
SELECT ?
FROM DB2.?
WHERE DB2_COLUMN = LCASE(:WS-COBOL-VARIABLE)
|
Or you can convert WS-COBOL-VARIABLE to lower case and then use it in the SQL. There are several post that address how to convert case. |
|
Back to top |
|
|
sandeep1dimri
New User
Joined: 30 Oct 2006 Posts: 76
|
|
|
|
hi ,
You can use a the below logic
Working storage.
WS-LOWER-CASE PIC X(26)
value 'abcdefghijklmnopqrstuvwxyz'.
WS-UPPER-CASE PIC X(26)
VALUE 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.
Procedure division.
INSPECT UR-Upper-case
CONVERTING WS-UPPER-CASE TO WS-LOWER-CASE.
select * from table where data=UR-Upper-case
Please move ur uper case value to variable UR-Upper-case and after inspect it will convert to lower case. Now with this varible UR-Upper-case u can put query against Database.
Please let me know if u stuck somewher in the above logic. |
|
Back to top |
|
|
|