Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SET ADDRESS OF - Working-Storage Item

Status
Not open for further replies.

WMK

Programmer
Jun 2, 2003
325
US
Just as a follow-up to another thread.

I could be mistaken, but as far as I know there is NO currently supported COBOL compiler that allows one to do a

Set pointer-data-item to ADDRESS OF Linkage-Section-Item

that does NOT also support

Set pointer-data-item to ADDRESS OF Working-Storage-Item

***

IBM's initial support for SET ADDRES OF was limited to linkage section items (only) but that was fixed about 4 releases ago. They don't even support (any more) the last release with that restriction.

Micro Focus has ALWAYS allowed one to get the address of a WS item - as does Fujitsu (although it is poorly documented in their manuals).

If anyone knows of a SUPPPORTED compiler that allows getting the address of a Linkage section item but not a Working-Storage item, I would be interested in knowing which it is.

Bill Klein
 
I know this thread was initiated because of one of my earlier replies.

Thanks, for the info...
I was not aware of this! It makes live simpler.
As you may guess...I am from the IBM mainframe environment.


Regards, Wim Ahlers.

P.S.
To tell you the truth I never understood why this could not have been done in the first place. Since a group level is nothing more then a displacement from the 01 level.
Since then I always accepted it and used the linkage.
 
Bill,

The following code fails with OPM COBOL/400 which I don't know if it is still supported or not. I think so but could not find a confirmation on the IBM site.

Machine with OS400 V5R1
Error message
MSGID: LBL1554 SEVERITY: 30 SEQNBR: 001100
Message . . . . : 'VAR-W' must be a Linkage Section item whose
level-number is not 66 or 88. ADDRESS OF ignored.



Code:
IDENTIFICATION DIVISION.                      
PROGRAM-ID. DEMO.                             
DATA DIVISION.                                
WORKING-STORAGE SECTION.                      
01  VAR-P     USAGE POINTER.                  
01  VAR-W                           PIC X(2). 
LINKAGE SECTION.                              
01  VAR-L                           PIC X(2). 
PROCEDURE DIVISION USING VAR-L.               
MAIN1.                                        
     SET VAR-P TO ADDRESS OF VAR-W.           < This fails
     SET VAR-P TO ADDRESS OF VAR-L.           < This works

Regards

Frederico Fonseca
SysSoft Integrated Ltd
 
It is not so difficult to make a work-around for this by calling an other program with your working-storage identifier and putting the address back into a second parm which is the pointer. I used that on the mainframe with one of the first releases of cobol/390.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top