Subject: | |
From: | |
Reply To: | |
Date: | Tue, 7 Jul 1998 08:28:07 -0400 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
Just off the top, if your using HPC/iX then the "int" that your using is
32 bits and in COBOL would be "PIC S9(9) COMP". Otherwise, use a "short
int" in the "C" program.
John Zoltak
North American Mfg Co
> -----Original Message-----
> From: Jens von Bülow [SMTP:[log in to unmask]]
> Sent: Tuesday, July 07, 1998 5:32 AM
> To: [log in to unmask]
> Subject: [HP3000-L] Cobol routine in XL called by C
>
> Greetings,
>
> I have not having much fun creating a Cobol routine and inserting it
> into an XL and then calling it from C. Yes, I have searched the
> archive, but did not solve my problem with some of the information
> gleaned. Does anybody have a simple example that they wish to share
> with the list.
>
> More precisely, my problems is simply that when I pass the address of
> an
> integer to the Cobol routine the Cobol routine always receives an
> integer of value 0 and when I modify the integer in Cobol when
> printed
> in C I get the incorrect value.
>
> Code samples.
>
> C 'client side'
> char request[256];
> char response[4096];
> int integer;
>
> democall(&request, &response, &integer);
>
>
> Cobol 'server side'
>
>
> LINKAGE SECTION.
>
> 01 REQUEST PIC X(256).
> 01 RESPONSE PIC X(4096).
> 01 SIZE-OF-BUFFER PIC S9(4) COMP.
>
> PROCEDURE DIVISION USING REQUEST,
> RESPONSE,
> SIZE-OF-BUFFER.
>
>
> All help greatly appreciated.
>
>
> Regards
> Jens
|
|
|