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
 

 

checking a variable for value other than alphabet

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

New User


Joined: 06 Oct 2010
Posts: 55
Location: india

PostPosted: Mon Oct 18, 2010 11:04 pm    Post subject: checking a variable for value other than alphabet
Reply with quote

how to check if a variable contains only alphabets or it has any special character or commas , fullstop also.
thanks..
Back to top
View user's profile Send private message

Phrzby Phil

Active Member


Joined: 31 Oct 2006
Posts: 964
Location: Richmond, Virginia

PostPosted: Mon Oct 18, 2010 11:14 pm    Post subject:
Reply with quote

What's fullstop?

Did you try anything yourself? What happened when you did?
Back to top
View user's profile Send private message
ankit saxena

New User


Joined: 06 Oct 2010
Posts: 55
Location: india

PostPosted: Mon Oct 18, 2010 11:24 pm    Post subject: re:
Reply with quote

actually i want to check whether t DSN name given by a user is proper or not for this i need to check whether it is free from any spl character apart from scope terminator (.) ,
but i m not getting any logic ... as to how to check.
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1771
Location: Bloomington, IL

PostPosted: Mon Oct 18, 2010 11:30 pm    Post subject:
Reply with quote

Get the EBCDIC ranges of the permitted characters; check each character in the purported DSN for these values (I'm not a COBOL programmer, but surely it has built-in functions like VERIFY, yes?).
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: Mon Oct 18, 2010 11:39 pm    Post subject:
Reply with quote

Hello,

You might consider defining a 1-byte working-storage field that has an 88-level that includes all of the valid values for your process.

Then compare each input byte against this (in a loop using reference modification, indexing, or subscripting). . .
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1281
Location: Belgium

PostPosted: Tue Oct 19, 2010 1:00 pm    Post subject:
Reply with quote

http://ibmmainframes.com/viewtopic.php?t=49281&highlight=
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 NDM syntax checking without actually ... GAPX1 All Other Mainframe Topics 0 Wed Jun 07, 2017 2:36 am
No new posts Can I traverse a STEM variable? chong.zhou CLIST & REXX 5 Wed May 31, 2017 3:54 pm
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Writing on to GSAM variable length rohanthengal JCL & VSAM 6 Fri Mar 03, 2017 7:46 pm


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