View previous topic :: View next topic
|
Author |
Message |
garuabhash
New User
Joined: 02 Nov 2005 Posts: 12 Location: Delhi
|
|
|
|
Hi,
I am working on a requirement in which I need to check whether lower or upper case letter are present in a string or not?
I need to check a string which is having few lower case, few upper case, few numbers and few special characters. I need to identify each of them and put them into an array. And then dispay the count of each one.
Please help me!
Thanks
garuabhash |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
The numbers are USAGE DISPLAY, not USAGE COMP or USAGE COMP-3? Have you clicked on the manuals link at the top of the page, clicked on the COBOL Language Reference manual, and searched for reference modification? If not, start there and let us know if you have any problems after reading.
Is this a homework assignment by some chance? |
|
Back to top |
|
|
garuabhash
New User
Joined: 02 Nov 2005 Posts: 12 Location: Delhi
|
|
|
|
Hi,
This is not a practice assignment.
Here the problem I am facing is, it is receiving the string from a cics screen and when I receive I could see all the string is in upper case.
I am searching for some function in cobol which will tell me that it is upper case letter, lower case letter, etc....
Thanks
garuabhash |
|
Back to top |
|
|
Ketan Varhade
Active User
Joined: 29 Jun 2009 Posts: 197 Location: Mumbai
|
|
|
|
Hi,
Quote: |
I receive I could see all the string is in upper case |
When once recieved you cannot trace it back for the lower case or uppercase,
check for the CICS program how it is sending the string to your program,
What and why is such requirement that you need to check for the case of the letter? |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
Unless the CICS support person has made provision for lower case data, your screen text will be translated to upper case before your program ever gets to see it. So you don't need a function to check for lower case. And reference modification will let you check for numeric digits. |
|
Back to top |
|
|
garuabhash
New User
Joined: 02 Nov 2005 Posts: 12 Location: Delhi
|
|
|
|
Hi,
Thanks for your reply.
But As per my requirement the cics program should receive the string in the same fashion how it has been entered on the screen. Actually this is a password field on the screen for some online transaction. In which user can enter the lower and upper case letter both. Event heir password can has number and special characters also.
Please tell me the way, how my online program can receive the value in the sane fashion as it entered on the screen.
Thanks
garuabhash |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
Back to top |
|
|
mallik4u
New User
Joined: 17 Sep 2008 Posts: 75 Location: bangalore
|
|
|
|
Hi,
What i understood from your post is that you are not able to get the same input from the screen (MAP) what user has entered.
This topic has been discussed earlier. Go through the following link...it might help you out.
http://www.ibmmainframes.com/post-54827.html |
|
Back to top |
|
|
acevedo
Active User
Joined: 11 May 2005 Posts: 344 Location: Spain
|
|
|
|
Robert Sample wrote: |
Unless the CICS support person has made provision for lower case data, your screen text will be translated to upper case before your program ever gets to see it. |
As Robert and Bill tried to explain...it's a question of the definition of the transaction...ask your systemers. |
|
Back to top |
|
|
Mickeydusaor
Active User
Joined: 24 May 2006 Posts: 258 Location: Salem, Oregon
|
|
|
|
You can also do this within your CICS program. You perform the routine
it will allow you to accept the input in both upper and lower case. You
perform the routine a 2nd time at it puts the terminal back in upper case.
as all terminals here are defined upper case.
Code: |
005400*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
005410* CHANGE TERMINAL TO MIXED CASE *
005420*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
005430 8300-CHANGE-CASE-SETTING.
005440
005450 EXEC CICS INQUIRE
005460 TERMINAL (EIBTRMID)
005470 UCTRANST (WS-UCTRANS)
005480 RESP (WS-CICS-RESPONSE)
005490 END-EXEC
005500
005510 IF WS-UCTRANS = DFHVALUE (UCTRAN)
005520 MOVE DFHVALUE (TRANIDONLY) TO WS-UCTRANS
005530 ELSE
005540 MOVE DFHVALUE (UCTRAN) TO WS-UCTRANS
005550 END-IF
005560
005570 EXEC CICS SET
005580 TERMINAL (EIBTRMID)
005590 UCTRANST (WS-UCTRANS)
005600 RESP (WS-CICS-RESPONSE)
005610 END-EXEC
005620 .
005630/
|
|
|
Back to top |
|
|
smilingashutosh
New User
Joined: 08 Jun 2006 Posts: 22
|
|
|
|
Robert,
Agreed with you, even in My case we have a seperate TransID when we need to receive case sensitive sgtring.
Ketan,
There could be n number of cases where you could need that like say you screen is displaying an offer name which is case sensitive data taken from a table then once you receive that data it will be received in upper case and next time upper case data will be updated in the table.
So you need to have possibly seperate transid for the screen program for which you want to store case sensitive data. |
|
Back to top |
|
|
garuabhash
New User
Joined: 02 Nov 2005 Posts: 12 Location: Delhi
|
|
|
|
Hi,
Thanks a lot for your response and help.
Please send me the working storage declarations also for the below variables.
WS-UCTRANS, UCTRAN, TRANIDONLY
Thanks
Abhash |
|
Back to top |
|
|
Mickeydusaor
Active User
Joined: 24 May 2006 Posts: 258 Location: Salem, Oregon
|
|
|
|
Here is the field for WS-UCTRANS, The others a CICS CVDA values found in the CICS System Programming Reference Manual.
UCTRAN is a value of 450 and TRANIDONLY is a value of 452.
Code: |
05 WS-UCTRANS PIC 9(08) BINARY VALUE 0. |
|
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
Getting back to the original question, you could use reference modification to move each byte of your string to a one-byte field that has some 88 levels defined on it:
Code: |
88 LOWER-CASE VALUE 'a' THRU 'i',
'j' THRU 'r',
's' THRU 'z'.
88 UPPER-CASE VALUE 'A' THRU 'I',
'J' THRU 'R',
'S' THRU 'Z'.
88 NUMBERS-ONLY VALUE '0' THRU '9'. |
This allows you to test each byte individually. You mentioned special characters so you'd want another 88 level for them -- but that's trivial to add. |
|
Back to top |
|
|
garuabhash
New User
Joined: 02 Nov 2005 Posts: 12 Location: Delhi
|
|
|
|
Hi,
Where do I need to add the Logic for 'changing the screen in mixed mode'.
I mean it should be before sending the screen or after receiving the screen.
Thanks
Garuabhash |
|
Back to top |
|
|
Mickeydusaor
Active User
Joined: 24 May 2006 Posts: 258 Location: Salem, Oregon
|
|
|
|
I make it one of the first things I do in the program and the last thing I do before returning back to cics. |
|
Back to top |
|
|
|