Set Address of linkage to Address of WS? 
Author Message
 Set Address of linkage to Address of WS?

I am now using IBM COBOL for MVS and VM and I can't seem to do what I did
using MF on HPUnix.

I was able to "SET ADDRESS OF an 01 dataname in Linkage TO ADDRESS OF a non
01 dataname in Working Storage.  Now I can't even set it to an 01 dataname.

Is this correct?

Did I lose the "dsect-ability"?

Bill

wthompson at okc dot disa dot mil

 Sent via Deja.com http://www.*-*-*.com/
 Share what you know. Learn what you don't.



Sun, 10 Feb 2002 03:00:00 GMT  
 Set Address of linkage to Address of WS?

Quote:

>I am now using IBM COBOL for MVS and VM and I can't seem to do what I did
>using MF on HPUnix.

>I was able to "SET ADDRESS OF an 01 dataname in Linkage TO ADDRESS OF a non
>01 dataname in Working Storage.  Now I can't even set it to an 01 dataname.

>Is this correct?

>Did I lose the "dsect-ability"?

Bill,

the COBOL for this and that does not allow ADDRESS OF working-storage-item.  But you can,
of course, use a small cobol program to overcome this problem:

 IDENTIFICATION DIVISION.
  Program-ID. GetAddr IS INITIAL.
 DATA DIVISION.
  WORKING-STORAGE SECTION.
  Linkage Section.
   01 Parm1               PIC X.
   01 Parm1-address       POINTER.
 PROCEDURE DIVISION USING Parm1 Parm1-address.
     SET Parm1-address TO ADDRESS OF Parm1
     GOBACK
     .

You use it like this

       Identification Division.
        Program-ID. AskAddr.
       Data Division.
        Working-Storage Section.
         01 Pgm-name              PIC X(8).
         01 Item-pointer          Pointer.
         01 Some-item.
            05 Some-sub-item  PIC X(13).
        Linkage Section.
         01 Some-Sub-Item-Dsect1.
            05 A PIC X(4).
            05 B PIC S9(4) BINARY.
            05 C PIC X(7).
         01 Some-Sub-Item-Dsect2.
            05 A PIC X(7).
            05 B PIC S9(4) BINARY.
            05 C PIC X(4).
       Procedure Division.
           MOVE 'Volker Bandke' TO Some-Sub-Item
           MOVE 'GETADDR' TO Pgm-name
           CALL Pgm-name USING some-sub-item, Item-pointer
           Set ADDRESS OF SOME-SUB-ITEM-DSECT1 TO Item-Pointer
           DISPLAY A OF Some-Sub-Item-DSECT1
           DISPLAY B OF Some-Sub-Item-DSECT1
           DISPLAY C OF Some-Sub-Item-DSECT1
           Set ADDRESS OF SOME-SUB-ITEM-DSECT2 TO Item-Pointer
           DISPLAY A OF Some-Sub-Item-DSECT2
           DISPLAY B OF Some-Sub-Item-DSECT2
           DISPLAY C OF Some-Sub-Item-DSECT2
           GOBACK
           .

Now you have DSECTing back.  I tested the program on the PC, using Visual Age COBOL for
NT.  It SHOULD therefore work on MVS as well

with kind regards

Volker Bandke
(BSP GmbH)



Sun, 10 Feb 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Set Address of linkage to Address of WS? -Reply

2. HandyMailTemplates - how to get email address from a recipients address

3. Locating the memory address range of a network card MAC address

4. Effective address to 'segmented' address

5. How to translate 16:16 address into linear address ?

6. Anyway to get the server ip address not the browser ip address

7. SET ADDRESS thingies

8. ioctl(set): no such device or address

9. ws-to-ws transfer

10. How to put an address in Outlook address book?

11. Winsock: dotted numeric addresses

12. Manugistic's email address or WWW site???

 

 
Powered by phpBB® Forum Software