IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Group item contained the PICTURE clause - error


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sm_2009

New User


Joined: 10 May 2009
Posts: 72
Location: bangalore

PostPosted: Wed May 27, 2009 11:11 am
Reply with quote

hi

I have declared a working storage variable as

Code:
05  WS-CHEQUE-NBR                PIC 9(6)      VALUE ZEROES.


but its giving compilation error as Group item "WS-CHEQUE-NBR" contained the "PICTURE" clause. The clause was discarded.

i am unable to find the reason for it. pls suggest.


thanks
Back to top
View user's profile Send private message
bipinpeter

Active User


Joined: 18 Jun 2007
Posts: 213
Location: Cochin/Kerala/India

PostPosted: Wed May 27, 2009 11:44 am
Reply with quote

Hi sm_2009,
We cant give PICTURE Clause for the group level variables.Just read the CObol manual for the Group level decalaration rules.
Back to top
View user's profile Send private message
sm_2009

New User


Joined: 10 May 2009
Posts: 72
Location: bangalore

PostPosted: Wed May 27, 2009 11:47 am
Reply with quote

But its not a group variable. as you can see the code, i have put it as an elementary variable.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed May 27, 2009 11:54 am
Reply with quote

debugging a single statement does not make sense,
the behavior is due to the statements surrounding the one You just posted

post the full definition and You might get better answers
Back to top
View user's profile Send private message
bipinpeter

Active User


Joined: 18 Jun 2007
Posts: 213
Location: Cochin/Kerala/India

PostPosted: Wed May 27, 2009 12:06 pm
Reply with quote

Hi sm_2009,
Just post the code below the
Code:
05  WS-CHEQUE-NBR                PIC 9(6)      VALUE ZEROES.

statement
Back to top
View user's profile Send private message
umasankarmf

New User


Joined: 08 Sep 2008
Posts: 43
Location: india

PostPosted: Wed May 27, 2009 12:18 pm
Reply with quote

Hi Bipin Peter,

If it is not group variable then the level number should be either 01 or 77.
Change the level number from 05 to 01 or 77, then it will work.
Back to top
View user's profile Send private message
sm_2009

New User


Joined: 10 May 2009
Posts: 72
Location: bangalore

PostPosted: Wed May 27, 2009 12:43 pm
Reply with quote

actually in working storage area i have declared as

01 work variables.
05 var1 pic x(02) value spaces.
05 ws-cheque-nbr pic 9(6) value zeroes.

error is giving at the particular line i have declared ws-cheque-nbr.

my question is for other fields its not giving this type of error as group variable, then for this variable only why this error is giving.

pls suggest.
Back to top
View user's profile Send private message
umasankarmf

New User


Joined: 08 Sep 2008
Posts: 43
Location: india

PostPosted: Wed May 27, 2009 12:52 pm
Reply with quote

can you tell me the next variable declaration after this group.
I think problem is in next variable declaration. please post that.
Back to top
View user's profile Send private message
manishmittal

New User


Joined: 25 Apr 2008
Posts: 49
Location: Gurgaon

PostPosted: Wed May 27, 2009 12:57 pm
Reply with quote

Please post the full code defined means statements belwo the ws-cheque-nbr.

It could be possible that your code contains :
01 work variables.
05 var1 pic x(02) value spaces.
05 ws-cheque-nbr pic 9(6) value zeroes.
10 ws-1 pix .
10 ws-2 pic x.

Then in aboce case ws-cheque-nbr will be considered as a group variable only.
Back to top
View user's profile Send private message
sm_2009

New User


Joined: 10 May 2009
Posts: 72
Location: bangalore

PostPosted: Wed May 27, 2009 1:03 pm
Reply with quote

ohh yes after that there are few program switches tht i have declared at level 10.

i changed the level nos below that ws-cheque-nbr to same 05 level.
now its fine.

thanks all.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed May 27, 2009 5:10 pm
Reply with quote

umasankarmf wrote:
Hi Bipin Peter,

If it is not group variable then the level number should be either 01 or 77.
Change the level number from 05 to 01 or 77, then it will work.


this above is not true.
umasankarmf does not know what he is talking about.
ignore his post.
Back to top
View user's profile Send private message
manishmittal

New User


Joined: 25 Apr 2008
Posts: 49
Location: Gurgaon

PostPosted: Wed May 27, 2009 5:29 pm
Reply with quote

I too echo with Dick.But if we change 05 to 01 or 77 it will really work.Though the statement"If it is not group variable then the level number should be either 01 or 77. " is not true.
Back to top
View user's profile Send private message
umasankarmf

New User


Joined: 08 Sep 2008
Posts: 43
Location: india

PostPosted: Wed May 27, 2009 5:37 pm
Reply with quote

Dick & Manish,

As per the 1st post he has given single line declaration, so I thought that it is independent variable. If it is a independent variable its level number shoul be either 01 or 77.

My previou post not for all conditions only for his question.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed May 27, 2009 5:50 pm
Reply with quote

You took the wrong approach, and You made a mistake,
nobody is going to kill You for that icon_biggrin.gif

as I said before
Quote:
debugging a single statement does not make sense,
the behavior is due to the statements surrounding the one You just posted
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Error to read log with rexx CLIST & REXX 11
No new posts Error when install DB2 DB2 2
No new posts CLIST - Virtual storage allocation error CLIST & REXX 5
No new posts Error while running web tool kit REXX... CLIST & REXX 5
No new posts Getting Error while trying to establi... DB2 3
Search our Forums:

Back to Top