Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Inspect a string for any french characters

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
Green_Star

New User


Joined: 13 Oct 2006
Posts: 7

PostPosted: Wed Apr 01, 2009 12:18 am    Post subject: Inspect a string for any french characters
Reply with quote

Hi,

I am interested in checking the input string for any of the listed french characters. The french character list is as follows:
âÄàáãåçéêëèíîïìÂÄÀÁÃÅÇÉÊËÈÍÎÏÌôÖòóõûÜùúÿÔÖÒÓÕÛÜÙÚ.
If the i/p string contains any one of these characters I convert the entire string to upper case.
Please advise on the best method to search for french characters in the i/p. I thought using INSPECT like
INSPECT INPUT-STRING TALLYING I FOR ALL "â"
J FOR ALL "Ä"
K FOR ALL "à" ............so on for all the characters in the list. But not sure if they is any better method for doing this. I am looking for something like
IF INPUT-STRING = 'â' OR 'Ä' OR 'à' OR.........etc. Atleast one occurence of any of the french characters is good for me.
Back to top
View user's profile Send private message

Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8119
Location: East Dubuque, Illinois, USA

PostPosted: Wed Apr 01, 2009 12:21 am    Post subject:
Reply with quote

Where is the input string coming from? Does the source have the right code page set?

I'd probably have a one-byte variable with an 88 level defining all the French characters. Use a loop for reference modification to move one byte at a time of your input string to the variable and use the 88 level to test; if you have a true do the upper case and exit the loop.
Back to top
View user's profile Send private message
Green_Star

New User


Joined: 13 Oct 2006
Posts: 7

PostPosted: Wed Apr 01, 2009 1:45 am    Post subject:
Reply with quote

Hi,
The requirement is like this:
Program ABC: For ex:
MOVE OWNER-NAME TO WS-NAME.
CALL 'subroutine XYZ' using WS-NAME.
Subroutine: XYZ
In this subroutine I plan to check WS-NAME for any french characters. If any french characters present then fix it by converting them to upper case else do not touch WS-NAME. I have to use this subroutine in many programs.

Thanks,
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Apr 01, 2009 1:52 am    Post subject:
Reply with quote

Hello,

Will only the "french" characters be changed to uppercase or the entire name?

You may want to define an array that has the "french" character and the "upper case" character you want to use to replace it.

I do not believe the UPPERCASE function will do what you want with the "french" characters. . .
Back to top
View user's profile Send private message
Green_Star

New User


Joined: 13 Oct 2006
Posts: 7

PostPosted: Wed Apr 01, 2009 2:03 am    Post subject:
Reply with quote

Thanks for you response.
I would change the entire string to uppercase using INSPECT CONVERTING.
My initial thought was as follows:

LINKAGE SECTION.
01 french-conv
05 input-string pic x(50).
05 output-string pic x(50).

procedure division using french-conv.
MOVE input-string to output-string.
INSPECT output-string TALLYING WK-FRECH-CHAR FOR FIRST 'âÄàáãåçéêëèíîïìÂÄÀÁÃÅÇÉÊËÈÍÎÏÌôÖòóõûÜùúÿÔÖÒÓÕÛÜÙÚ'

IF WK-FRENCH-CHAR > ZEROES
INSPECT output-string converting "âÄàáãåçéêëèíîïìÂÄÀÁÃÅÇÉÊËÈÍÎÏÌôÖòóõûÜùúÿÔÖÒÓÕÛÜÙÚabcdefghijklmnopqrstuvwxyz" to "AAAAAACEEEEIIIIAAAAAACEEEEIIIIOOOOOUUUUYOOOOOUUUUABCDEFGHIJKLMNOPQRSTUVWXYZ".

But I guess the INSPECT TALLYING doesn't work here for this situation..
Please advise.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Apr 01, 2009 2:08 am    Post subject:
Reply with quote

Hello,

No, but you could set up an 88-level for the french-values and run thru a loop using reference modification (per Robert's suggestion).

When the first french char was detected, you should then be able to use the inspect/convert. There would be no need to search the entire string and count all of the "hits".
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Fileaid Update Replace with null string descann Compuware & Other Tools 4 Mon May 15, 2017 3:00 pm
No new posts Replacing same string with different ... vickey_dw DFSORT/ICETOOL 6 Wed Feb 22, 2017 10:44 pm
No new posts Count Trailing Spaces in variable str... Virendra Shambharkar SYNCSORT 10 Thu Feb 02, 2017 12:23 pm
No new posts Remove junk values in a file and rite... KP1125 DFSORT/ICETOOL 2 Wed Jan 25, 2017 9:58 pm
This topic is locked: you cannot edit posts or make replies. Checking wether a string starts from ... sundaram.naveen CLIST & REXX 9 Thu Oct 06, 2016 11:56 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us