John,
I didnt realize you could call C library functions directly, very cool ,
here is what i would like to do:
FILE SECTION.
WORKING-STORAGE SECTION.
77 TESTSTR PIC X(30) VALUE SPACES.
77 VAR1 PIC S9(9) BINARY VALUE 5.
PROCEDURE DIVISION.
0000-MAIN.
* MOVE 1 TO P1.
* DISPLAY 'P1: ' P1
* CALL 'CFUNC' USING P1 RETURNING P2
* DISPLAY 'P1: ' P1
* DISPLAY 'P2: ' P2
STRING 'TEST STRING' ,
LOW-VALUE
DELIMITED BY SIZE INTO TESTSTR
DISPLAY 'CALL CENTRY USING: ' TESTSTR
CALL 'CENTRY' USING TESTSTR.
GOBACK.
<c>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void CENTRY(char* mystring)
{
printf("my string: %s \n",mystring);
}
I am trying to understand how to perform the call and pass a string and or
a integer ...
Thanks John..
Regards.
Scott
On Tue, May 30, 2017 at 2:19 PM, John McKown <[email protected]>
wrote:
> On Tue, May 30, 2017 at 1:07 PM, scott Ford <[email protected]> wrote:
>
> > All:
> >
> > I saw a thread between Peter Fairley and John in April, this year
> speaking
> > about a cobol program calling C ..I am in the same board but did not see
> > the C code. Can some one help me out and point me to the C routine or
> > function ?
> >
>
> Minor example at:
> https://gist.github.com/JohnArchieMckown/5b973d46108bd24e0c6f9233c96176b0
>
> Calls the C subroutines: cuserid(), strlen(). and sscanf(). I don't have a
> C compiler, so I don't have an example of any "user written" C code.
>
>
>
> >
> > Thanks and I appreciate it
> >
> > --
> >
> > *IDMWORKS *
> >
> > Scott Ford
> >
> > z/OS Dev.
> >
>
>
> --
> Windows. A funny name for a operating system that doesn't let you see
> anything.
>
> Maranatha! <><
> John McKown
>
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to [email protected] with the message: INFO IBM-MAIN
>
--
*IDMWORKS *
Scott Ford
z/OS Dev.
“By elevating a friend or Collegue you elevate yourself, by demeaning a
friend or collegue you demean yourself”
www.idmworks.com
[email protected]
Blog: www.idmworks.com/blog
*The information contained in this email message and any attachment may be
privileged, confidential, proprietary or otherwise protected from
disclosure. If the reader of this message is not the intended recipient,
you are hereby notified that any dissemination, distribution, copying or
use of this message and any attachment is strictly prohibited. If you have
received this message in error, please notify us immediately by replying to
the message and permanently delete it from your computer and destroy any
printout thereof.*
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN