Subject: | |
From: | |
Reply To: | Walter J. Murray |
Date: | Wed, 16 Aug 2006 21:20:58 -0700 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
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 *
|
|
|