Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 968
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: 1784
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 Moving a COMP-3 Variable to a Numeric... ajayachander COBOL Programming 2 Thu Dec 14, 2017 5:46 pm
No new posts Move from Comp3 variable to Edited Va... Revathy.nair0485 COBOL Programming 7 Fri Nov 03, 2017 3:30 pm
This topic is locked: you cannot edit posts or make replies. Can a alphanumeric data be moved to a... nico_neoz COBOL Programming 10 Mon Oct 30, 2017 8:28 am
No new posts Moving values to a variable of copybo... Vignesh Sid COBOL Programming 6 Wed Sep 06, 2017 1:04 pm
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us