View previous topic :: View next topic
|
Author |
Message |
shekhar1s
New User
Joined: 13 Apr 2006 Posts: 14 Location: USA
|
|
|
|
Can we initialize 88 level condition name variable?
88 ABC-Y VALUE 'Y'
INITIALIZE ABC-Y |
|
Back to top |
|
|
chandan.inst
Active User
Joined: 03 Nov 2005 Posts: 275 Location: Mumbai
|
|
|
|
Hi Shekhar,
yes you can initilaize your variable with 88 level value but not in the way you did
For example
Code: |
05 WS-A PIC X(1) VALUE 'N'.
88 ABC-Y VALUE 'Y' . |
to set WS-A to 'Y' you need to mention like below
Addition to this I would suggest go through the CObol manulas to understand the basic concepts.
Regards,
Chandan |
|
Back to top |
|
|
shekhar1s
New User
Joined: 13 Apr 2006 Posts: 14 Location: USA
|
|
|
|
Ohh Sorry, I mean to say that what happens if we initialize it like below:
INITIALIZE ABC-Y
Will it reset to spaces? or will it retain the value 'Y' or some error? |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
Looks like an interview question
why didnt you try writing a small program |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
A field declared with a level number of 88 is commonly known as a 'condition name'. They use no storage, for proof, check the excellent post from Robert (Sample) in this thread.
The INITIALIZE statement sets selected categories of data fields to predetermined values. It is functionally equivalent to one or more MOVE statements. And the MOVE statement transfers data from one area of storage to one or more other areas.
If you add these tidbits, you'll understand the question does not stand on practical grounds. INITIALIZE work on storage and 88-levels take no storage.
You can also treat 88-levels as toggle-switch -- which is by its very nature, is either ON or OFF. If you've multiple conditions to check from, then too, only one switch is ON. If by INITIALIZE you mean to put all the conditions either ON or OFF - that is not what this level is designed for. |
|
Back to top |
|
|
shekhar1s
New User
Joined: 13 Apr 2006 Posts: 14 Location: USA
|
|
|
|
Thanks Anuj, for so good explanation... i would assume that this would be the compiler error. |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
Phew
Assume yet this shows you have not written a 10 line code |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
i would assume that this would be the compiler error. |
If there was a compiler error that you did not understand, you should have posted the relevant code and the compiler error(s).
By not postng the "real" issue initially, this just wasted several iterations and people's time. |
|
Back to top |
|
|
shekhar1s
New User
Joined: 13 Apr 2006 Posts: 14 Location: USA
|
|
|
|
I am sorry but i did not write any program for this, the question just got into my mind so thought of asking here as it got so many good brains...
And if you feel that this is just wastage of time... i don't feel so... it opens mind of people those reading this post and thinking for the solution and explanation... Also as some people said this could be the good question for interview... if you really want to test the people thoughts... How good would be the technical skills when the person answers something like Anuj...
Time never ever wasted my friend... everyday we learn something from
stupid/intelligent questions or discussion... we are still learners... so be cool and have patience... |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
1.You never searched
2.I believe there was just the same question a few days back in the very same forum
3.Again ( I am trying to sound like a friend) coming to my point if you had just read the manual and provided you are able to articulate the examples and concept of 88 level variables and searching forum I bet you could have developed all permutation and combinations of code and you would have mastered it yourself
4.There wouldnt have been the need to prolong the thread for 2 days
5.It might be painful even after explanation you dont give attempt to try and blindly say you 'Assume'
6.Its like teaching people for free who shows no interest
7.Last but not the All experts would be happy to see programmers who show intrest in resolving their own techincal problems
8.(I am no expert yet ) |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
We just had this thread starting May 31st. shekhar1s, did you even TRY to search the forum before posting your question? Because you basically asked EXACTLY the same thing. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
And if you feel that this is just wastage of time... i don't feel so... it opens mind of people those reading this post and thinking for the solution and explanation... |
Hopefully, you will change your "feeling". It is very much off the mark . . .
As was mentioned, this was asked only a week or so ago. As you have been here for more than 6 we can only hope that you would know how to use the forum Search.
This forum expects to have members with some level of experience and this topic is covered in the first year of COBOL training. People are also expected to try things on their system and if strange things occur, post what they tried and what happened - posting relevant info so we can help.
As far as "cool and patience" do you not understnd that if we were not these, your topic would have been locked and you probably would have been Warned of worse. |
|
Back to top |
|
|
|