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
 
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: 1048
Location: Oostende, Belgium

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: 111
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: 8154
Location: East Dubuque, Illinois, 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

Global Moderator


Joined: 14 Mar 2007
Posts: 10308
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: 397
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: 1788
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 User


Joined: 29 Apr 2008
Posts: 175
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
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 Sorting on text - but in non-alphabet... Roy Ware SYNCSORT 5 Wed Aug 23, 2017 9:15 pm
No new posts XML Parse for COBOL 5.2 Bhanu Praveen COBOL Programming 1 Sat Jul 08, 2017 8:58 pm
No new posts Dynamic output file creation in cobol... smileheal COBOL Programming 7 Thu Jun 15, 2017 10:53 pm
No new posts Search utility(3.14) using JCl and Cobol RKS3 COBOL Programming 12 Sat Jun 10, 2017 10:24 pm

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