Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
ALPHABETIC check in COBOL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: ALPHABETIC check in COBOL
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: 1161
Location: Vilnius, Lithuania

PostPosted: Thu Aug 17, 2017 7:44 pm    Post subject:
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: 114
Location: Puerto Rico

PostPosted: Thu Aug 17, 2017 7:46 pm    Post subject:
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    Post subject:
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: 8491
Location: Dubuque, Iowa, USA

PostPosted: Thu Aug 17, 2017 8:08 pm    Post subject: Reply to: ALPHABETIC check in COBOL
Reply with quote

The Enterprise COBOL V6.1 Language Reference manual is at http://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

Senior Member


Joined: 14 Mar 2007
Posts: 10626
Location: italy

PostPosted: Thu Aug 17, 2017 8:32 pm    Post subject: Reply to: ALPHABETIC check in COBOL
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: 447
Location: USA

PostPosted: Thu Aug 17, 2017 8:59 pm    Post subject: Reply to: ALPHABETIC check in COBOL
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

Senior Member


Joined: 21 Sep 2010
Posts: 2271
Location: NY,USA

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

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

Active Member


Joined: 29 Apr 2008
Posts: 566
Location: Maryland

PostPosted: Fri Aug 18, 2017 10:46 pm    Post subject: Re: Reply to: ALPHABETIC check in COBOL
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    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 COBOL -DB2 SQL code to have GROUP BY ... vinu78 DB2 3 Wed Oct 23, 2019 7:00 pm
No new posts How to handle NULL in COBOL program bhaskar_kanteti COBOL Programming 8 Mon Oct 07, 2019 3:54 pm
This topic is locked: you cannot edit posts or make replies. COBOL/CICS with real time MQ Series u... BPranav CICS 2 Mon Sep 16, 2019 9:19 pm
This topic is locked: you cannot edit posts or make replies. Compare two files logic in COBOL Nishant Singhal COBOL Programming 4 Sun Aug 25, 2019 2:25 am
No new posts How to check ASRA ABEND TivyaWorld CICS 2 Fri Aug 09, 2019 1:08 pm

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