IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search Log in to check your private messages Log in
 

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: 8568
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: 7312
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

 

Search our Forum:

Similar Topics
Topic Forum Replies
No new posts FILE STATUS - 39 ON VARIABLE LENGTH V... COBOL Programming 1
No new posts Getting error while xped JCL & VSAM 10
No new posts Hexadecimal Group compare and write t... DFSORT/ICETOOL 5
No new posts DB2 group member usage DB2 0
No new posts can someone please help me in finding... IBM Tools 9

Back to Top