HP3000-L Archives

October 2002, Week 3

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Michael Berkowitz <[log in to unmask]>
Reply To:
Michael Berkowitz <[log in to unmask]>
Date:
Tue, 15 Oct 2002 08:39:34 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (39 lines)
Tony Summers writes

Anybody know of a way to get a cobol's program-Id "into" the procedure
division ?

eg.   Something like ....

 IDENTIFICATION DIVISION.
 PROGRAM-ID.          PRABCD.
 WORKING-STORAGE SECTION.
 1   WORK-TEMP                 PIC X(20).
 PROCEDURE DIVISION.
 MDEXAA-MASTER SECTION.
*
    MOVE PROGRAM-ID        TO WORK-TEMP.
    DISPLAY WORK-TEMP
-------------------------------------------------------------
Well if you really want to get it in a round about way do the following.

1.  CALL INTRINSIC "PROCINFO"
        with pin = 0 (yourself) and item 10 to return the name of the
running program.

2.  COPY running program to another file name.  If program is running can't
run LINKEDIT

3.  FILE discfilename;DEV=DISC;TEMP;NOCCTL;REC=-80,,F,ASCII;DISC=10000

4.  LINKEDIT "LISTPROG copied filename" >*discfilename

5.  Read discfilename looking for "pri_p".  If found program id in first
columns.

Mike Berkowitz
Guess? Inc.

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2