View previous topic :: View next topic
|
Author |
Message |
vidyaa
New User
Joined: 02 May 2008 Posts: 77 Location: chennai
|
|
|
|
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 |
|
 |
prino Warnings : 1 Senior Member

Joined: 07 Feb 2009 Posts: 1238 Location: Vilnius, Lithuania
|
|
|
|
Why the flipping 'ell don't you try, rather than wasting our time here? |
|
Back to top |
|
 |
Jose Mateo
Active User
Joined: 29 Oct 2010 Posts: 121 Location: Puerto Rico
|
|
|
|
Both are correct. |
|
Back to top |
|
 |
vidyaa
New User
Joined: 02 May 2008 Posts: 77 Location: chennai
|
|
|
|
Thanks
Jose Mateo |
|
Back to top |
|
 |
Robert Sample
Global Moderator

Joined: 06 Jun 2008 Posts: 8569 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
 |
enrico-sorichetti
Senior Moderator

Joined: 14 Mar 2007 Posts: 10712 Location: italy
|
|
|
|
what happened when You tested it with a small COBOL program ?
or when You looked at the COBOL manuals ?
 |
|
Back to top |
|
 |
RahulG31
Active User
Joined: 20 Dec 2014 Posts: 446 Location: USA
|
|
|
|
'Is' is Not correct. You should use 'Are'.
So, the correct statement is:
. |
|
Back to top |
|
 |
Rohit Umarjikar
Global Moderator

Joined: 21 Sep 2010 Posts: 2567 Location: NYC,USA
|
|
|
|
Good one!! RahulG31  |
|
Back to top |
|
 |
sergeyken
Active Member

Joined: 29 Apr 2008 Posts: 924 Location: Maryland
|
|
|
|
RahulG31 wrote: |
'Is' is Not correct. You should use 'Are'.
So, the correct statement is:
|
One can also understand this as:
Quote: |
Is "both" correct?
(or it must be replaced with "boss"?) |
 |
|
Back to top |
|
 |
|