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: 1206
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: 120
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: 8551
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: 10691
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: 2427
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: 803
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 CALL statement in COBOL for VSE Kirthishine COBOL Programming 1 Fri Jun 26, 2020 12:12 pm
No new posts Want to check if trailer count is 0 a... rohanthengal JCL & VSAM 10 Fri Jun 26, 2020 10:47 am
No new posts Question for Cobol Report Writer jackzhang75 COBOL Programming 3 Wed May 27, 2020 4:35 am
No new posts Compare multiple files using JCL/Rexx... tanvi110788 JCL & VSAM 4 Tue May 19, 2020 5:47 pm
No new posts Need example for CALL 'ISRSUPC' in COBOL Sue Adams COBOL Programming 2 Thu May 14, 2020 5:32 am

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