HP3000-L Archives

July 1998, Week 1

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:
John Zoltak <[log in to unmask]>
Reply To:
John Zoltak <[log in to unmask]>
Date:
Tue, 7 Jul 1998 08:28:07 -0400
Content-Type:
text/plain
Parts/Attachments:
text/plain (58 lines)
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

ATOM RSS1 RSS2