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
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: How to trim cursor and find special char in a field?
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7254

PostPosted: Wed Jul 25, 2012 3:57 pm    Post subject: Reply to: How to trim cursor and find special char in a fiel
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    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7254

PostPosted: Wed Jul 25, 2012 4:14 pm    Post subject: Reply to: How to trim cursor and find special char in a fiel
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

Site Director


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

PostPosted: Wed Jul 25, 2012 7:08 pm    Post subject:
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: 2502
Location: Atlanta, Georgia, USA

PostPosted: Wed Jul 25, 2012 7:23 pm    Post subject: Reply to: How to trim cursor and find special char in a fiel
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 -

http://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    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 INVALID FIELD OR CONSTANT IN SORTOF ?? Ron Klop DFSORT/ICETOOL 8 Wed Jan 11, 2017 3:44 pm
No new posts find particular member name in PDS us... ravi243 CLIST & REXX 10 Mon Dec 19, 2016 6:44 pm
No new posts Performing arithmetic on input field zh_lad DFSORT/ICETOOL 31 Tue Dec 06, 2016 8:04 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts How to find the first monday of the w... abdulrafi COBOL Programming 10 Fri Nov 25, 2016 3:24 pm


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