HP3000-L Archives

July 2001, Week 4

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:
EricKundl <[log in to unmask]>
Reply To:
EricKundl <[log in to unmask]>
Date:
Tue, 24 Jul 2001 12:04:40 -0600
Content-Type:
text/plain
Parts/Attachments:
text/plain (167 lines)
are  you sure you are using the cobol 85 compiler?

this main and sub works ok:

$CONTROL POST85
 IDENTIFICATION DIVISION.
 PROGRAM-ID.    TXMAIN.
 DATA DIVISION.
 WORKING-STORAGE SECTION.

 01  abc         pic x(10) is external.
 01  field1      pic x(01).

 PROCEDURE DIVISION.
 BEGIN.
     move "1234567890" to abc
     perform CallRoutine.
 STOP RUN.

 CallRoutine.
     call "TXSUB" using Field1.



$CONTROL DYNAMIC
 IDENTIFICATION DIVISION.
 PROGRAM-ID.    TXSUB.
 DATA DIVISION.
 WORKING-STORAGE SECTION.
 01  abc         pic x(10) is external.

 LINKAGE SECTION.
 01  field1      pic x(01).

 PROCEDURE DIVISION using field1.
 BEGIN.
     display "ABC=", abc
 goback.

i used the hp command COB85XL to compile it.

here is the run:
run txmain.exe

ABC=1234567890

END OF PROGRAM



thanks,
Eric Kundl
Colorado Springs, CO
http://members.home.net/ekundl1/
  ----- Original Message ----- 
  From: Shahan, Ray 
  To: 'EricKundl' ; Shahan, Ray ; [log in to unmask] 
  Sent: Tuesday, July 24, 2001 11:49 AM
  Subject: RE: COBOL


  Thanks, I tried that but it didn't work either...the manual doesn't suggest
  this either(http://www.docs.hp.com/cgi-bin/doc3k/B3150090013.11820/223)...of
  course, I can't find what I'm doing wrong from the manual, so your
  suggestion was certainly worthy of a shot...again, thanks.

  > -----Original Message-----
  > From: EricKundl [SMTP:[log in to unmask]]
  > Sent: Tuesday, July 24, 2001 12:33 PM
  > To: Shahan, Ray; [log in to unmask]
  > Subject: Re:      COBOL
  > 
  > i believe you need to put $CONTROL POST85 in the top of your main program
  > to use EXTERNAL.
  >  
  > thanks,
  > Eric Kundl
  > Colorado Springs, CO
  > <http://members.home.net/ekundl1/>
  > 
  > ----- Original Message ----- 
  > From: Shahan, Ray <mailto:[log in to unmask]> 
  > To: [log in to unmask] <mailto:[log in to unmask]> 
  > Sent: Tuesday, July 24, 2001 10:54 AM
  > Subject: COBOL
  > 
  > Hi all,
  > 
  > I'm trying to (in a hurry), use the EXTERNAL clause on a WS 01 level
  > for
  > passing some subprog info, but while it appears to work in as much
  > as the
  > run unit executes, I don't seem to be getting any data in the sub
  > from the
  > main.
  > 
  > I've included a snippet of both source codes, so can you please give
  > a look
  > and see what/if I'm missing something...thanks all.
  > 
  > MAIN:
  > 
  > WORKING-STORAGE SECTION.
  >   01 ABC                   EXTERNAL   PIC X(10).
  >   01  XREF-ARRAY                      IS EXTERNAL.
  >       05  XREF-TABLE-SIZE-SW          PIC S9(04) COMP.
  >           88  XREF-TABLE-SIZE                         VALUE 10.
  >       05  XREF-TABLE                  OCCURS 10 TIMES
  >                                       INDEXED BY XREF-IDX.
  >           10  XREF-ENTRY              PIC S9(04) COMP.
  > 
  >   01  FIELD-1                         PIC 9(1) VALUE 1.
  >   01  FIELD-2                         PIC 9(1) VALUE 8.
  > 
  > /
  >   PROCEDURE DIVISION.
  > 
  >   0000-START.
  > 
  >       MOVE "ABCDEFGHIJ"           TO ABC.
  >       SET XREF-TABLE-SIZE         TO TRUE.
  >       PERFORM VARYING XREF-IDX FROM 1 BY 1
  >       ;       UNTIL   (XREF-IDX > XREF-TABLE-SIZE-SW)
  >       ;   SET XREF-ENTRY(XREF-IDX) TO XREF-IDX
  >       END-PERFORM.
  >         CALL "IQ2" USING FIELD-1.
  > 
  > SUB:
  > 
  > WORKING-STORAGE SECTION.
  > 
  > 01  ABC                    EXTERNAL PIC X(10).
  > 01  XREF-ARRAY                      IS EXTERNAL.
  >     05  XREF-TABLE-SIZE-SW          PIC S9(04) COMP.
  >         88  XREF-TABLE-SIZE                         VALUE 10.
  >     05  XREF-TABLE                  OCCURS 10 TIMES
  >                                     INDEXED BY XREF-IDX.
  >         10  XREF-ENTRY              PIC S9(04) COMP.
  > 
  >     01  FIELD-2                     PIC 9(01)  VALUE 1.
  > 
  > LINKAGE SECTION.
  >     01  FIELD-1                     PIC 9(01).
  > 
  > PROCEDURE DIVISION USING FIELD-1.
  > 
  > 0000-START.
  > 
  >      DISPLAY " "
  >      DISPLAY "BEGIN DISPLAY OF EXTERNAL ARRAY"
  >      DISPLAY "'" ABC "'"
  >      DISPLAY "'" XREF-ARRAY "'".
  > 
  > ANSWER:
  > 
  > BEGIN DISPLAY OF EXTERNAL ARRAY
  > ''
  > ''
  > 
  > * To join/leave the list, search archives, change list settings, *
  > * etc., please visit <http://raven.utc.edu/archives/hp3000-l.html> *
  > 
  >

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

ATOM RSS1 RSS2