View previous topic :: View next topic
|
Author |
Message |
seshagir
New User
Joined: 12 Sep 2007 Posts: 4 Location: chennai
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
mytags
New User
Joined: 28 Apr 2008 Posts: 63 Location: US
|
|
|
|
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 |
|
|
yogeshwar_ade
Active User
Joined: 31 Aug 2006 Posts: 103 Location: INDIA
|
|
|
|
These topics are discussed many times on this forum. Please make search on this. |
|
Back to top |
|
|
vasanthkumarhb
Active User
Joined: 06 Sep 2007 Posts: 275 Location: Bang,iflex
|
|
|
|
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 |
|
|
Phrzby Phil
Senior Member
Joined: 31 Oct 2006 Posts: 1042 Location: Richmond, Virginia
|
|
|
|
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 |
|
|
|