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

checking a variable for value other than alphabet


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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

Senior Member


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

PostPosted: Mon Oct 18, 2010 11:14 pm
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
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: 1788
Location: Bloomington, IL

PostPosted: Mon Oct 18, 2010 11:30 pm
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

Moderator Emeritus


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

PostPosted: Mon Oct 18, 2010 11:39 pm
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
Reply with quote

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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Variable Output file name DFSORT/ICETOOL 8
No new posts Moving Or setting POINTER to another ... COBOL Programming 2
No new posts parsing variable length/position data... DFSORT/ICETOOL 5
No new posts Masking variable size field - min 10 ... DFSORT/ICETOOL 4
Search our Forums:

Back to Top