Maybe because the VMS people made the assumption that any language can call any other, so no specific documentation is needed? That was one of the goals of VAX, and it should have carried to Alpha. So assuming that the data type mapping is clear, nothing else should need to be said.
paul
On Sep 12, 2012, at 3:22 PM, Sampsa Laine wrote:
Well I always wanted to play with COBOL lol.
It's just infuriating how there's no decent docs on how to call a damn C function anywhere.
I mean there is for DEC UNIX COBOL, but not VMS.
On 12 Sep 2012, at 22:00, Mark Wickens wrote:
Sampsa,
I've said it before, I'll say it again - your vintage forays sometimes make me look distinctly normal ;)
Keep up the good work!
Mark.
Well I always wanted to play with COBOL lol.
It's just infuriating how there's no decent docs on how to call a damn C function anywhere.
I mean there is for DEC UNIX COBOL, but not VMS.
On 12 Sep 2012, at 22:00, Mark Wickens wrote:
Sampsa,
I've said it before, I'll say it again - your vintage forays sometimes make me look distinctly normal ;)
Keep up the good work!
Mark.
Ah,
That for example calling C from COBOL is for OSF/1 only. I wonder how one does this on VMS..
Sampsa
On 12 Sep 2012, at 21:10, Michael Young wrote:
found this at odl.sysworks.biz/disk$axpdocdec971/progtool/d37aaa48.p341.bkb#2110 :
Example 12-8: C Include File " cobfunc "
void cobcancel ( /* CANCEL the named COBOL routine */
char *name
);
int cobcall ( /* Call a COBOL program from a C routine */
char *name, /* READ: name of the program */
int argc, /* READ: how many arguments */
char **argv /* READ: array of pointers to the arguments */
);
int cobfunc ( /* Call a COBOL program from a C routine, then CANCEL it */
char *name, /* name of the program */
int argc, /* how many arguments */
char **argv /* array of pointers to the arguments */
);
#ifdef __osf__
void cob_init ( /* init the RTL */
int argc, /* argument count */
char **argv, /* arguments */
char **envp /* environment variable pointers */
);
#endif
--Mike
On Sep 12, 2012, at 1:54 PM, Sampsa Laine <sampsa at mac.com> wrote:
Does anybody happen to have a nice sample bit of code on how to call a C function from DEC COBOL?
The documentation gave me this code:
/* crtn - c function to test use of argc and argv in c routines
* called from HP COBOL */
#include "cobfunc.h"
#include <stdio.h>
extern int _ _Argc;
extern char **_ _Argv[];
#define argc _ _Argc
#define argv (*_ _Argv)
void crtn()
{
int i;
i = 0;
for (i = 0; i < argc; i++) {
printf("argv[%d] = %s\n", i, argv[i]);
}
}
But I can't find cobfunc.h anywhere
Sampsa
On 12 Sep 2012, at 20:18, Sampsa Laine wrote:
Well this whole COBOL thing is verging on the humour value anyway, I think I might leave that til later :)
Sampsa
On 12 Sep 2012, at 20:13, Jordi Guillaumes i Pons wrote:
IIRC there was no screen section support in VAX COBOL.
Perhaps this can be a good excuse to learn the SMG$ RTL routines...
Jordi Guillaumes i Pons
Barcelona - Catalunya - Europa
El 12/09/2012, a les 17:10, Sampsa Laine <sampsa at mac.com> va escriure:
Tried to compile my little program on GORVAX but it has problems with the SCREEN SECTION that works on the AXP version..
I'm thinking I must have an old compiler or something. Anyone know what the latest is?
Anyone have a kit?
Sampsa
Michael Young
young at ecn.purdue.edu
Unfortunately that's the opposite way, C -> COBOL.
Going to look on that website.
Sampsa
On 12 Sep 2012, at 21:10, Michael Young wrote:
found this at odl.sysworks.biz/disk$axpdocdec971/progtool/d37aaa48.p341.bkb#2110 :
Example 12-8: C Include File " cobfunc "
void cobcancel ( /* CANCEL the named COBOL routine */
char *name
);
int cobcall ( /* Call a COBOL program from a C routine */
char *name, /* READ: name of the program */
int argc, /* READ: how many arguments */
char **argv /* READ: array of pointers to the arguments */
);
int cobfunc ( /* Call a COBOL program from a C routine, then CANCEL it */
char *name, /* name of the program */
int argc, /* how many arguments */
char **argv /* array of pointers to the arguments */
);
#ifdef __osf__
void cob_init ( /* init the RTL */
int argc, /* argument count */
char **argv, /* arguments */
char **envp /* environment variable pointers */
);
#endif
--Mike
On Sep 12, 2012, at 1:54 PM, Sampsa Laine <sampsa at mac.com> wrote:
Does anybody happen to have a nice sample bit of code on how to call a C function from DEC COBOL?
The documentation gave me this code:
/* crtn - c function to test use of argc and argv in c routines
* called from HP COBOL */
#include "cobfunc.h"
#include <stdio.h>
extern int _ _Argc;
extern char **_ _Argv[];
#define argc _ _Argc
#define argv (*_ _Argv)
void crtn()
{
int i;
i = 0;
for (i = 0; i < argc; i++) {
printf("argv[%d] = %s\n", i, argv[i]);
}
}
But I can't find cobfunc.h anywhere
Sampsa
On 12 Sep 2012, at 20:18, Sampsa Laine wrote:
Well this whole COBOL thing is verging on the humour value anyway, I think I might leave that til later :)
Sampsa
On 12 Sep 2012, at 20:13, Jordi Guillaumes i Pons wrote:
IIRC there was no screen section support in VAX COBOL.
Perhaps this can be a good excuse to learn the SMG$ RTL routines...
Jordi Guillaumes i Pons
Barcelona - Catalunya - Europa
El 12/09/2012, a les 17:10, Sampsa Laine <sampsa at mac.com> va escriure:
Tried to compile my little program on GORVAX but it has problems with the SCREEN SECTION that works on the AXP version..
I'm thinking I must have an old compiler or something. Anyone know what the latest is?
Anyone have a kit?
Sampsa
Michael Young
young at ecn.purdue.edu
found this at odl.sysworks.biz/disk$axpdocdec971/progtool/d37aaa48.p341.bkb#2110 :
Example 12-8: C Include File " cobfunc "
void cobcancel ( /* CANCEL the named COBOL routine */
char *name
);
int cobcall ( /* Call a COBOL program from a C routine */
char *name, /* READ: name of the program */
int argc, /* READ: how many arguments */
char **argv /* READ: array of pointers to the arguments */
);
int cobfunc ( /* Call a COBOL program from a C routine, then CANCEL it */
char *name, /* name of the program */
int argc, /* how many arguments */
char **argv /* array of pointers to the arguments */
);
#ifdef __osf__
void cob_init ( /* init the RTL */
int argc, /* argument count */
char **argv, /* arguments */
char **envp /* environment variable pointers */
);
#endif
--Mike
On Sep 12, 2012, at 1:54 PM, Sampsa Laine <sampsa at mac.com> wrote:
Does anybody happen to have a nice sample bit of code on how to call a C function from DEC COBOL?
The documentation gave me this code:
/* crtn - c function to test use of argc and argv in c routines
* called from HP COBOL */
#include "cobfunc.h"
#include <stdio.h>
extern int _ _Argc;
extern char **_ _Argv[];
#define argc _ _Argc
#define argv (*_ _Argv)
void crtn()
{
int i;
i = 0;
for (i = 0; i < argc; i++) {
printf("argv[%d] = %s\n", i, argv[i]);
}
}
But I can't find cobfunc.h anywhere
Sampsa
On 12 Sep 2012, at 20:18, Sampsa Laine wrote:
Well this whole COBOL thing is verging on the humour value anyway, I think I might leave that til later :)
Sampsa
On 12 Sep 2012, at 20:13, Jordi Guillaumes i Pons wrote:
IIRC there was no screen section support in VAX COBOL.
Perhaps this can be a good excuse to learn the SMG$ RTL routines...
Jordi Guillaumes i Pons
Barcelona - Catalunya - Europa
El 12/09/2012, a les 17:10, Sampsa Laine <sampsa at mac.com> va escriure:
Tried to compile my little program on GORVAX but it has problems with the SCREEN SECTION that works on the AXP version..
I'm thinking I must have an old compiler or something. Anyone know what the latest is?
Anyone have a kit?
Sampsa
Michael Young
young at ecn.purdue.edu
Does anybody happen to have a nice sample bit of code on how to call a C function from DEC COBOL?
The documentation gave me this code:
/* crtn - c function to test use of argc and argv in c routines
* called from HP COBOL */
#include "cobfunc.h"
#include <stdio.h>
extern int _ _Argc;
extern char **_ _Argv[];
#define argc _ _Argc
#define argv (*_ _Argv)
void crtn()
{
int i;
i = 0;
for (i = 0; i < argc; i++) {
printf("argv[%d] = %s\n", i, argv[i]);
}
}
But I can't find cobfunc.h anywhere
Sampsa
On 12 Sep 2012, at 20:18, Sampsa Laine wrote:
Well this whole COBOL thing is verging on the humour value anyway, I think I might leave that til later :)
Sampsa
On 12 Sep 2012, at 20:13, Jordi Guillaumes i Pons wrote:
IIRC there was no screen section support in VAX COBOL.
Perhaps this can be a good excuse to learn the SMG$ RTL routines...
Jordi Guillaumes i Pons
Barcelona - Catalunya - Europa
El 12/09/2012, a les 17:10, Sampsa Laine <sampsa at mac.com> va escriure:
Tried to compile my little program on GORVAX but it has problems with the SCREEN SECTION that works on the AXP version..
I'm thinking I must have an old compiler or something. Anyone know what the latest is?
Anyone have a kit?
Sampsa
Well this whole COBOL thing is verging on the humour value anyway, I think I might leave that til later :)
Sampsa
On 12 Sep 2012, at 20:13, Jordi Guillaumes i Pons wrote:
IIRC there was no screen section support in VAX COBOL.
Perhaps this can be a good excuse to learn the SMG$ RTL routines...
Jordi Guillaumes i Pons
Barcelona - Catalunya - Europa
El 12/09/2012, a les 17:10, Sampsa Laine <sampsa at mac.com> va escriure:
Tried to compile my little program on GORVAX but it has problems with the SCREEN SECTION that works on the AXP version..
I'm thinking I must have an old compiler or something. Anyone know what the latest is?
Anyone have a kit?
Sampsa
IIRC there was no screen section support in VAX COBOL.
Perhaps this can be a good excuse to learn the SMG$ RTL routines...
Jordi Guillaumes i Pons
Barcelona - Catalunya - Europa
El 12/09/2012, a les 17:10, Sampsa Laine <sampsa at mac.com> va escriure:
Tried to compile my little program on GORVAX but it has problems with the SCREEN SECTION that works on the AXP version..
I'm thinking I must have an old compiler or something. Anyone know what the latest is?
Anyone have a kit?
Sampsa
Oleg Safiullin wrote:
Sampsa Laine wrote:
Turns out I got version COBOL057.
Is there something newer out there?
COBOL_Compiler_57.zip;1
You have latest one.