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
 
Regarding the Variables

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
seshagir

New User


Joined: 12 Sep 2007
Posts: 4
Location: chennai

PostPosted: Fri May 16, 2008 10:20 am    Post subject: Regarding the Variables
Reply with quote

I have few questions regarding declaration variables in COBOL Programs.

1. Why 77 level variables are not preferred in COBOL programs.
2. Which is preferred? Comp or Comp-3 variables. Why?

Regards,
Seshagiri
Back to top
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri May 16, 2008 12:00 pm    Post subject:
Reply with quote

Hello,

Quote:
1. Why 77 level variables are not preferred in COBOL programs.
Who/what says they are not preferred? They can be used with no problems. . .

Quote:
2. Which is preferred? Comp or Comp-3 variables. Why?
Eash has uses. Neither is necessarily preferred. The choice is dependent on the need at the time. If you post a requirement, soneome will reply wioth a suggestion as to which would be the better choice.
Back to top
View user's profile Send private message
mytags

New User


Joined: 28 Apr 2008
Posts: 63
Location: US

PostPosted: Fri May 16, 2008 12:16 pm    Post subject:
Reply with quote

Hi seshagir,
From my knowledge, i have seen that 77 level is only preferred for single items.as we know 01 can also be used with group items ,but 77 not.but in case of comp and comp3 we are using it depends upon the amount of storage spaces we can use or we can say it as a situation depended also.So i feel what 'Dick' told is right.
thanks
hari
Back to top
View user's profile Send private message
yogeshwar_ade

Active User


Joined: 31 Aug 2006
Posts: 103
Location: INDIA

PostPosted: Fri May 16, 2008 12:26 pm    Post subject: Reply to: Regarding the Variables
Reply with quote

These topics are discussed many times on this forum. Please make search on this.
Back to top
View user's profile Send private message
vasanthkumarhb

Active User


Joined: 06 Sep 2007
Posts: 276
Location: Bang,iflex

PostPosted: Fri May 16, 2008 12:45 pm    Post subject:
Reply with quote

Hi,


77 level variables is used as independent variable and these variables doesnot involves elementary variables, that is the speciality of this variable,

Who says it is not prefferred? it is preffered for the cause and requirement.

COMP or COMP-3 usage depends on your requirement, that is for fast addressability and for storing the values or data in packed formatt.
Back to top
View user's profile Send private message
Phrzby Phil

Active Member


Joined: 31 Oct 2006
Posts: 965
Location: Richmond, Virginia

PostPosted: Fri May 16, 2008 5:59 pm    Post subject:
Reply with quote

Some programmers follow a style whereby they group similar variables, e.g., flags or switches, under a 01 level, e.g.:

Code:
01  FLAGS.
    05  FLAG-1     PIC X.
    05  FLAG-2     PIC X.


If you do this, you would have few 77's.
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 DB2 9.1.0 not move values to Host-Var... Miguel Fernandez DB2 8 Wed Jan 25, 2017 8:24 pm
No new posts DB2 9.1.0 not move values to Host-Var... Miguel Fernandez DB2 0 Wed Jan 25, 2017 8:23 pm
No new posts DB2 9.1.0 not move values to Host-Var... Miguel Fernandez DB2 0 Wed Jan 25, 2017 8:21 pm
No new posts Protection Exception while move 0 to ... Kevin Vaz CICS 10 Tue Oct 18, 2016 4:19 pm
No new posts Is it possible to pass variables of s... Csongor CLIST & REXX 2 Fri Jun 10, 2016 7:33 pm

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