IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to trim cursor and find special char in a field?


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Gopalakrishnan V

Active User


Joined: 28 Jun 2010
Posts: 102
Location: chennai

PostPosted: Wed Jul 25, 2012 1:34 pm
Reply with quote

In a CICS map field we have to enter name of 40 char, initially it having cursor to enter the new field. If we enter 10 char in middle then remaining cursor field should get trimmed and only alphabets should get moved.

Also i should not accept the special char among these 40 chars. How can we identify easily.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Wed Jul 25, 2012 3:57 pm
Reply with quote

I don't understand your first paragraph, so please clarify. Write sufficient with the idea that we know nothing about the problem you are describing.

For your validation, it may be easier to identify the characters which are allowed. Remember, certain punctuation characters are valid in some "European" names, if you have any of those.
Back to top
View user's profile Send private message
Gopalakrishnan V

Active User


Joined: 28 Jun 2010
Posts: 102
Location: chennai

PostPosted: Wed Jul 25, 2012 4:08 pm
Reply with quote

Code:

 ACT  ID   NAME                             
  _   ___  ________________________________________
  _   001  MAINFRAME                                     



The name field should accept only alphabets not any special characters and numbers. How can we omit special chars?

Also while entering the name, no need to enter from first position may be from middle. For that how can we trim cursors alone?
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Wed Jul 25, 2012 4:14 pm
Reply with quote

Consult the Cobol manual for ALPHABETIC- class tests.

Still no clear idea what you mean about the rest. Not even no clear. No idea at all.

So, you wait for someone else or you describe exactly what you want to do so that someone who doesn't know what you want to do can understand what you want to do.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Wed Jul 25, 2012 7:08 pm
Reply with quote

Hello,

It will help if you use only standard terminology. I have never heard of "trimming a cursor". . .

It appears you did not read (or understand) what Bill posted:
Quote:
For your validation, it may be easier to identify the characters which are allowed. Remember, certain punctuation characters are valid in some "European" names, if you have any of those.


Quote:
How can we identify easily.
Depends on what you consider easily.
One way to get what i believe you want is to define the field as a 1-byte array and beginning from the right look for the first non-blank character. From that point, continue to the left ensuring that every character is "valid" for the field until you reach the first character. Then discard leading spaces if you do not want them.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Wed Jul 25, 2012 7:23 pm
Reply with quote

What are the characters you need to keep as-is?

Once you've determined this, then it's just a matter of building a "From" and "To" table for a subsequent INSPECT, with the "From table" containing all 256-entries of X'00' through X'FF' and the "To table" having only the "keepers" and the remaining "To Table" entries containing SPACES.

Click here on a previous post which may help -

www.ibmmainframes.com/viewtopic.php?p=143786&highlight=#143786
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts TRIM everything from input, output co... DFSORT/ICETOOL 1
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts Exclude rows with > than x occurre... DFSORT/ICETOOL 6
Search our Forums:

Back to Top