HP3000-L Archives

August 2006, 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:
Craig Lalley <[log in to unmask]>
Reply To:
Craig Lalley <[log in to unmask]>
Date:
Thu, 17 Aug 2006 18:37:29 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (77 lines)
I really love it, when someone who KNOW's what they are talking about replies.  :-)

-Craig


"Walter J. Murray" <[log in to unmask]> wrote: Michael Anderson wrote:

[snip]
> but I guess I am going to have
> find an HP3000  with C/iX and AIFINTR on it to write a subroutine that
> would call AIF on behalf of the COBOL program.

Don't give up on COBOL.  You shouldn't need C/iX or Pascal/iX or even
AIFINTR.  Here's some code to get you started.  I'm not going to test
it, but I expect it will work, if you get all the data items set up
correctly in Working-Storage.  (The PICTURE clauses in this program
should work OK.)  I can tell you that this program generates the same
code as if you declare AIFCHANGELOGON as an intrinsic and compile on a
system that does have AIFINTR.

-----cut here-----
IDENTIFICATION DIVISION.
 PROGRAM-ID. AIF-TEST.
*AUTHOR.  WALTER J. MURRAY.
 DATA DIVISION.
 WORKING-STORAGE SECTION.
 01  OVERALL-STATUS    PIC X(4).
 01  LOGON-CMD         PIC X(128).
 01  LOGON-DESC        PIC X(112).
 01  OPTIONS           PIC S9(9)    COMP.
 01  ERROR-STATUS      PIC X(4).
 01  USER-ID           PIC S9(9)    COMP.
 PROCEDURE DIVISION.
 MAIN.
     CALL "\AIFCHANGELOGON" USING
             \6\
             OVERALL-STATUS
             LOGON-CMD
             LOGON-DESC
             \OPTIONS\
             ERROR-STATUS
             \USER-ID\
     STOP RUN.
 END PROGRAM AIF-TEST.
-----cut here-----

Notes.
1.  The '\' preceding the name of the intrinsic in the CALL statement
prevents the compiler from downshifting the name.
2.  The slashes surrounding OPTIONS and USER-ID force those operands to
be passed by value instead of by reference.  
3.  The \6\ causes the integer 6 to be passed by value as the first
parameter, specifying the number of parameters actually passed.  This is
part of the OPTION EXTENSIBLE mechanism of Pascal/iX.

Calling intrinsics from COBOL can be an enjoyable pastime.  You just
have to know what the intrinsic is expecting, and then figure out how to
persuade the COBOL compiler to produce it.  Some of the intrinsics are
more challenging than this one.

Enjoy!

Walter  

Walter J. Murray

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


 		
---------------------------------
How low will we go? Check out Yahoo! Messenger’s low  PC-to-Phone call rates.

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

ATOM RSS1 RSS2