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

pic clause on group variable error


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

New User


Joined: 28 Feb 2012
Posts: 9
Location: India

PostPosted: Mon Jul 14, 2014 6:33 pm
Reply with quote

Hi ,
I am getting an error while mapping a copy book to a file using start tool ... It says 'pic clause not allowed on group variable'
On the last variable in the copy book

Can anyone help plss ...
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Mon Jul 14, 2014 6:43 pm
Reply with quote

What is "start tool"? "Pic clause not allowed on group variable" means exactly that. PIC clauses are allowed only on elementary items.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Mon Jul 14, 2014 6:52 pm
Reply with quote

I suspect there is a level number issue -- if the copy book has 05 WS-X and the next variable in your program has 07 WS-Y then WS-X would be a group variable.
Back to top
View user's profile Send private message
CuriousMainframer

New User


Joined: 28 Feb 2012
Posts: 9
Location: India

PostPosted: Mon Jul 14, 2014 7:41 pm
Reply with quote

Well , I have defined by copy book something like this
01 ws-rec.
03 ws-rec-header.
05 ws-rec-action pic x(1).
05 ws-rec-version pic 9(4).
03 ws-rec-data.
05 ws-name pic x(30).
05 ws-city pic x(20).
05 ws-dob pic x(10).

I am getting an error pointing to the last variable
Ws-dob. There are no variables in the file after it.
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Mon Jul 14, 2014 8:03 pm
Reply with quote

CuriousMainframer wrote:
Well , I have defined by copy book something like this
01 ws-rec.
03 ws-rec-header.
05 ws-rec-action pic x(1).
05 ws-rec-version pic 9(4).
03 ws-rec-data.
05 ws-name pic x(30).
05 ws-city pic x(20).
05 ws-dob pic x(10).

I am getting an error pointing to the last variable
Ws-dob. There are no variables in the file after it.

But are there variables after it in the copybook; that, as the mad prince of Denmark said, is the question. Copy and paste -- do not type by hand "something like it" -- the copybook here.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Jul 14, 2014 8:38 pm
Reply with quote

For the message, you should find that, whether in your copybook, another copybook, or just in the program, that the dob 05-level is followed by a level-number greater than 05.

Code:
    05  dob-thing pic x.
* here's the useful comment saying "end of copybook" but so what....

* here's a great big useless comment block which says "work fields" or similar....

        10  a completely-separate-item PIC X.


If we normalise the names, level-numbers and comments, that is what you have.
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Mon Jul 14, 2014 8:38 pm
Reply with quote

Please copy/paste the error message along with the lines before and after and use Code tags. I suspect Akatsukami is correct but we can't tell for sure unless you show us the above.
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 Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Error when install DB2 DB2 2
No new posts CLIST - Virtual storage allocation error CLIST & REXX 5
No new posts Variable Output file name DFSORT/ICETOOL 8
Search our Forums:

Back to Top