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

ALPHABETIC check in COBOL


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
vidyaa

New User


Joined: 02 May 2008
Posts: 77
Location: chennai

PostPosted: Thu Aug 17, 2017 7:13 pm
Reply with quote

Hi,

Can we code the ALPHABETIC check in cobol as follows

IF VAR1 ALPHABETIC
MOVE A TO B

or do I need to code IS ALPHABETIC

IF VAR1 IS ALPHABETIC
MOVE A TO B

Is both correct ?
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Thu Aug 17, 2017 7:44 pm
Reply with quote

Why the flipping 'ell don't you try, rather than wasting our time here?
Back to top
View user's profile Send private message
Jose Mateo

Active User


Joined: 29 Oct 2010
Posts: 121
Location: Puerto Rico

PostPosted: Thu Aug 17, 2017 7:46 pm
Reply with quote

Both are correct.
Back to top
View user's profile Send private message
vidyaa

New User


Joined: 02 May 2008
Posts: 77
Location: chennai

PostPosted: Thu Aug 17, 2017 7:54 pm
Reply with quote

Thanks
Jose Mateo
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Thu Aug 17, 2017 8:08 pm
Reply with quote

The Enterprise COBOL V6.1 Language Reference manual is at publibfp.boulder.ibm.com/epubs/pdf/igy6lr10.pdf and page 264 gives the syntax diagram for class conditions. The syntax diagram makes it very clear that the IS can be part of the statement or not -- programmer's choice.

Bookmark this reference manual -- if you use it before posting you will resolve most of this type of question without needing to post anything. This IS an expert's forum and you are expected to be able to do your own research BEFORE posting a question.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Aug 17, 2017 8:32 pm
Reply with quote

Quote:
Is both correct ?


what happened when You tested it with a small COBOL program ?
or when You looked at the COBOL manuals ?
icon_evil.gif
Back to top
View user's profile Send private message
RahulG31

Active User


Joined: 20 Dec 2014
Posts: 446
Location: USA

PostPosted: Thu Aug 17, 2017 8:59 pm
Reply with quote

Quote:
Is both correct ?

'Is' is Not correct. You should use 'Are'.

So, the correct statement is:
Quote:
Are both correct?

icon_biggrin.gif

.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3053
Location: NYC,USA

PostPosted: Fri Aug 18, 2017 8:54 pm
Reply with quote

Good one!! RahulG31 icon_biggrin.gif
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2023
Location: USA

PostPosted: Fri Aug 18, 2017 10:46 pm
Reply with quote

RahulG31 wrote:
Quote:
Is both correct ?

'Is' is Not correct. You should use 'Are'.

So, the correct statement is:
Quote:
Are both correct?

icon_biggrin.gif

One can also understand this as:
Quote:
Is "both" correct?
(or it must be replaced with "boss"?)

icon_razz.gif
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 Replace each space in cobol string wi... COBOL Programming 3
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts SCOPE PENDING option -check data DB2 2
Search our Forums:

Back to Top