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: 962
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: 1746
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: 1278
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
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
No new posts Syncsort - NULL in Integer field chec... nartcr SYNCSORT 4 Thu Oct 06, 2016 6:47 am
No new posts Format to pipe delimited with variabl... pshongal SYNCSORT 6 Wed Sep 14, 2016 2:48 pm
No new posts Reasonable way of checking wildcards ... sergeyken CLIST & REXX 5 Wed Sep 07, 2016 8:43 pm
No new posts Variable for cursor names ravikumar15 DB2 5 Sun Jul 17, 2016 7:08 am


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