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
 

 

Cobol Conditions to check a variable

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

New User


Joined: 29 Dec 2010
Posts: 31
Location: Mumbai

PostPosted: Thu Mar 10, 2011 11:24 am    Post subject: Cobol Conditions to check a variable
Reply with quote

Hi,

Cobol Variable "NAME" should be only alpha, apostrophe,period or dash else i should generate the error.

Please guide me on how to perform this check on the variable. icon_smile.gif
Back to top
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6967
Location: porcelain throne

PostPosted: Thu Mar 10, 2011 12:13 pm    Post subject: Re: Cobol Conditions
Reply with quote

santohsks1987 wrote:
Hi,

Cobol Variable "NAME" should be only alpha, apostrophe,period or dash else i should generate the error.

Please guide me on how to perform this check on the variable. icon_smile.gif


hard to guide you when we do not know what you are doing when
Quote:

i should generate the error.


why not wait for the compiler?
Back to top
View user's profile Send private message
santohsks1987
Warnings : 1

New User


Joined: 29 Dec 2010
Posts: 31
Location: Mumbai

PostPosted: Thu Mar 10, 2011 12:18 pm    Post subject:
Reply with quote

I have a variable NAME, I am performing validations on this variable and the check which i have to do is

If NAME = alpha, apostrophe, period or dash
continue
else
set error-flag
end-if

How to perform the if check
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6967
Location: porcelain throne

PostPosted: Thu Mar 10, 2011 12:34 pm    Post subject:
Reply with quote

you could use the CLASS Clause found in COBOL Reference and the PROGRAMERS Guide
Back to top
View user's profile Send private message
Dsingh29

Active User


Joined: 16 Dec 2008
Posts: 132
Location: IBM

PostPosted: Fri Mar 11, 2011 12:23 pm    Post subject:
Reply with quote

Please go through the below link.

http://www.cobolportal.com/resources/articles/20000403_001.asp?bhcp=1
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 Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
This topic is locked: you cannot edit posts or make replies. Cobol GUI (like Editor) Kala Mainframe COBOL Programming 14 Wed May 10, 2017 12:30 pm
No new posts IMS T-Pipe queue counts in a COBOL Pr... Siva NKK Kothamasu IMS DB/DC 0 Tue May 09, 2017 6:31 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm


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