Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
How to create a Pointer in copybook

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe COBOL
Author Message
sree reddy

New User


Joined: 20 Jul 2007
Posts: 69
Location: bangalore

PostPosted: Wed Jul 01, 2009 1:16 am    Post subject: How to create a Pointer in copybook
Reply with quote

Hi,

The below is the description given in the Specification documents.

Create a pointer to copybook XXXXXXXX:cXXX-work-area
remove 4 bytes of filler for the pointer.

Can any one please let me know how to code this in the copybook as early as possible

Thanks
Back to top
View user's profile Send private message
References
dick scherrer

Global Moderator


Joined: 23 Nov 2006
Posts: 13556
Location: 221 B Baker St

PostPosted: Wed Jul 01, 2009 1:24 am    Post subject:
Reply with quote

Hello,

You will get quicker/better replies if you more clearly explain what you want to do. . . Your intent is completely clear to you, but not to everyone else.

Post more complete info and maybe someone can help.
Back to top
View user's profile Send private message
Bill O'Boyle

Active Member


Joined: 14 Jan 2008
Posts: 986
Location: South Carolina, USA

PostPosted: Wed Jul 01, 2009 2:21 am    Post subject: Reply to: How to create a Pointer in copybook
Reply with quote

Dick,

I'm going to guess (and this is purely a SWAG) that he needs to define something similar to an ADCON to automatically point to the "01" copybook-level as a separate "01" POINTER included in the copybook.

IE:
Code:

01  COPYBOOK-GROUP.
    03  BLAH-BLAH-01 PIC  X(10).
    03  BLAH-BLAH-02 PIC  X(10).
    03  BLAH-BLAH-03 PIC  X(10).

01  COPYBOOK-POINTER POINTER.

If this is what he wants to do, AFAIK (unless someone has some tricky way) it can't be done automatically in COBOL.

It can be done in the PROCEDURE DIVISION -
Code:

SET COPYBOOK-POINTER TO ADDRESS OF COPYBOOK-GROUP.

However, having said that, if this copybook resides in WORKING-STORAGE as opposed to LINKAGE, the minimum COBOL compiler to support this is OS/390 COBOL 2.2 (about 10 years ago).

If the copybook is in LINKAGE, the minimum COBOL compiler is VS/COBOL II, which was the first COBOL compiler to support POINTERS. But a S0C4 will be raised, unless 4-bytes of addressability have been allocated to COPYBOOK-POINTER. Keep in mind that if addressability has not yet been established to the "01", the resulting POINTER value will most likely be garbage.

Ah yes, the tangled web we weave.... icon_wink.gif

Regards,
Back to top
View user's profile Send private message
sree reddy

New User


Joined: 20 Jul 2007
Posts: 69
Location: bangalore

PostPosted: Wed Jul 01, 2009 2:27 am    Post subject: thanks
Reply with quote

Thanks i got it
Back to top
View user's profile Send private message
dick scherrer

Global Moderator


Joined: 23 Nov 2006
Posts: 13556
Location: 221 B Baker St

PostPosted: Wed Jul 01, 2009 3:10 am    Post subject: Reply to: How to create a Pointer in copybook
Reply with quote

Hi Bill,

Good catch icon_smile.gif

I'm still puzzled by this from the original post
Quote:
remove 4 bytes of filler for the pointer.
whatever it refers to. . . Sounds like it may not be an issue at this point?

d
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe COBOL All times are GMT + 6 Hours
Page 1 of 1