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
 
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: 6968
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: 6968
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 IEW2456E error when link-editing a C ... Senthilraj JCL & VSAM 0 Fri Oct 13, 2017 3:12 pm
No new posts Assembler Macro Copybook converted to... Ziquilix PL/I & Assembler 4 Tue Sep 26, 2017 3:07 am
No new posts Moving values to a variable of copybo... Vignesh Sid COBOL Programming 6 Wed Sep 06, 2017 1:04 pm
This topic is locked: you cannot edit posts or make replies. Extract all "IF" Statements... Adarsh Damodaran CLIST & REXX 1 Wed Sep 06, 2017 9:28 am
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