DEC-BASIC Capablities - VMS

This is a discussion on DEC-BASIC Capablities - VMS ; Hi, I'm relatively new to this environment, so I'm hoping to get some info from this forum. On one side I have an application running on OpenVMS written in DEC- BASIC which maintains RMS files. On the other side I ...

+ Reply to Thread
Results 1 to 16 of 16

Thread: DEC-BASIC Capablities

  1. DEC-BASIC Capablities

    Hi,

    I'm relatively new to this environment, so I'm hoping to get some info
    from this forum.

    On one side I have an application running on OpenVMS written in DEC-
    BASIC which maintains RMS files.
    On the other side I have a relational DB (Cache from InterSystems)

    The relational DB allows me to extract/update information into it via
    a number of methods, namely, via ODBC calls, or programs written in C,
    C++, Java, .NET... and other technologies.

    The task is to modify the DEC-BASIC information such that I can send
    data to the relational Database. Whilst I know the capabilities
    afforded to me by the rdbms side, I do not knwo what capabilities DEC-
    BASIC has.

    so -

    1/ Does DEC-BASIC have commands that allow me to make ODBC calls ? If
    so - what do I need to set this up?
    2/ Can a DEC-BASIC program call a C++ program ? If so - does this need
    to be "linked" in with the BASIC object.
    3/ Can a DEC-BASIC program call a Java program ?

    Any feedback appreciated..

    Thanks

    Steve

  2. Re: DEC-BASIC Capablities

    Steve Pisani wrote:
    > Hi,
    >
    > I'm relatively new to this environment, so I'm hoping to get some info
    > from this forum.
    >
    > On one side I have an application running on OpenVMS written in DEC-
    > BASIC which maintains RMS files.
    > On the other side I have a relational DB (Cache from InterSystems)
    >
    > The relational DB allows me to extract/update information into it via
    > a number of methods, namely, via ODBC calls, or programs written in C,
    > C++, Java, .NET... and other technologies.
    >
    > The task is to modify the DEC-BASIC information such that I can send
    > data to the relational Database. Whilst I know the capabilities
    > afforded to me by the rdbms side, I do not knwo what capabilities DEC-
    > BASIC has.
    >
    > so -
    >
    > 1/ Does DEC-BASIC have commands that allow me to make ODBC calls ? If
    > so - what do I need to set this up?


    Yes. Just call your ODBC routine as you would any other BASIC
    subroutine. You will need to link with the library containing it.
    Never done it. You may need to tell the linker where to find it.
    > 2/ Can a DEC-BASIC program call a C++ program ?

    Yes
    > If so - does this need
    > to be "linked" in with the BASIC object.

    Yes.
    > 3/ Can a DEC-BASIC program call a Java program ?

    I don't think so but I'm not really an expert on anything to do with
    Java. You would probably have to call LIB$SPAWN to create a process to
    run the Java interpreter.

  3. Re: DEC-BASIC Capablities

    Steve Pisani wrote:
    > Hi,
    >
    > I'm relatively new to this environment, so I'm hoping to get some info
    > from this forum.
    >
    > On one side...


    What is a "side" ???

    > I have an application running on OpenVMS written in DEC-
    > BASIC which maintains RMS files.
    > On the other side I have a relational DB (Cache from InterSystems)
    >
    > The relational DB allows me to extract/update information into it via
    > a number of methods, namely, via ODBC calls, or programs written in C,
    > C++, Java, .NET... and other technologies.
    >
    > The task is to modify the DEC-BASIC information...


    Are you talking about the RMS files ?
    That isn't "DEC-BASIC information" as such, it just
    RMS files...

    > such that I can send
    > data to the relational Database. Whilst I know the capabilities
    > afforded to me by the rdbms side, I do not knwo what capabilities DEC-
    > BASIC has.
    >
    > so -
    >
    > 1/ Does DEC-BASIC have commands that allow me to make ODBC calls ? If
    > so - what do I need to set this up?


    Are you talking about ODBC calls from say a Windows environment ?
    Or local ODBC calls on the VMS system ?

    There is (was?) some kind of driver that would let you
    make ODBC calls from a PC to RMS files just as to any
    other "database". It *might* have been throught the
    "Transparent Gateway For RMS" that once was part of Rdb.

    I think that you should have less focus on DEC-BASIC and
    look closer at your RMS files instead.

    Is this a one-time conversion ? Or what functionality
    do you need? Transactions? 2PC between RMS and CachÚ?

    Jan-Erik.

    > 2/ Can a DEC-BASIC program call a C++ program ? If so - does this need
    > to be "linked" in with the BASIC object.
    > 3/ Can a DEC-BASIC program call a Java program ?
    >
    > Any feedback appreciated..
    >
    > Thanks
    >
    > Steve


  4. Re: DEC-BASIC Capablities

    On Apr 28, 8:21 am, Steve Pisani
    wrote:
    > Hi,
    >
    > I'm relatively new to this environment, so I'm hoping to get some info
    > from this forum.
    >
    > On one side I have an application running on OpenVMS written in DEC-
    > BASIC which maintains RMS files.
    > On the other side I have a relational DB (Cache from InterSystems)
    >
    > The relational DB allows me to extract/update information into it via
    > a number of methods, namely, via ODBC calls, or programs written in C,
    > C++, Java, .NET... and other technologies.
    >
    > The task is to modify the DEC-BASIC information such that I can send
    > data to the relational Database. Whilst I know the capabilities
    > afforded to me by the rdbms side, I do not knwo what capabilities DEC-
    > BASIC has.
    >
    > so -
    >
    > 1/ Does DEC-BASIC have commands that allow me to make ODBC calls ? If
    > so - what do I need to set this up?


    No, at least not natively. There may be some third party software
    available that gives the capability.

    > 2/ Can a DEC-BASIC program call a C++ program ? If so - does this need
    > to be "linked" in with the BASIC object.


    Yes. You can CHAIN to another program, or call modules written in c/c+
    +. See http://h71000.www7.hp.com/doc/82final/5973/5973PRO.HTML.

    > 3/ Can a DEC-BASIC program call a Java program ?


    Yes. See answer to 1. If you are going to call JAVA modules, you
    will need to write c/c++ wrapper(s) to expose the JAVA functions in a
    way Basic can pass any arguments needed. With the WSIT toolkit you
    can go JAVA->Basic, but the last time I looked at it, it did not
    provide any help going the other way.


  5. Re: DEC-BASIC Capablities

    In article <60abd1e3-674d-452f-ad33-2e0ffa83907b@y38g2000hsy.googlegroups.com>, Steve Pisani writes:
    >
    > 1/ Does DEC-BASIC have commands that allow me to make ODBC calls ? If
    > so - what do I need to set this up?


    I might be possible that the ODBC API was written in such a way as
    not to be directly callable form BASIC, but I doubt it.

    > 2/ Can a DEC-BASIC program call a C++ program ? If so - does this need
    > to be "linked" in with the BASIC object.


    Yes, you can mix all native languages on VMS. All the objects must
    be linked together no matter what language(s) the source is in.

    > 3/ Can a DEC-BASIC program call a Java program ?


    Yes. The JNI for calling Java from native languages and the tools
    that support it are for C, but you can interface between C and BASIC.
    What you won't find is the tools or API definitions for working
    directly in BASIC.

    There is a VMS document on modular programming, and sections of each
    compiler's Users Guide which will help you with everything except
    the JNI. The JNI documentation is downloadable with the JDK documnetion.


  6. Re: DEC-BASIC Capablities

    Steve Pisani wrote:
    > I'm relatively new to this environment, so I'm hoping to get some info
    > from this forum.
    >
    > On one side I have an application running on OpenVMS written in DEC-
    > BASIC which maintains RMS files.
    > On the other side I have a relational DB (Cache from InterSystems)
    >
    > The relational DB allows me to extract/update information into it via
    > a number of methods, namely, via ODBC calls, or programs written in C,
    > C++, Java, .NET... and other technologies.
    >
    > The task is to modify the DEC-BASIC information such that I can send
    > data to the relational Database. Whilst I know the capabilities
    > afforded to me by the rdbms side, I do not knwo what capabilities DEC-
    > BASIC has.
    >
    > so -
    >
    > 1/ Does DEC-BASIC have commands that allow me to make ODBC calls ? If
    > so - what do I need to set this up?


    If you have a Cache ODBC driver for VMS and you are
    capable of writing Basic code that calls the ODBC API (which
    is C based) as C would, then YES.

    Basic---(ODBC)---Cache ODBC------Cache

    > 2/ Can a DEC-BASIC program call a C++ program ? If so - does this need
    > to be "linked" in with the BASIC object.


    You can call C++ functions declared with extern "C" without any
    problems. VMS has excellent cross-language capabilities (for
    procedural programming).

    Basic---(your C style API)---C++---(ODBC)---Cache ODBC------Cache

    This still requires an ODBC driver for VMS.

    > 3/ Can a DEC-BASIC program call a Java program ?


    Yes.

    Basic---(JNI)---Java---(JDBC)---Cache

    If the JDBC driver is a type 4 driver you can use a
    generic driver (does not need a VMS specifc).

    But the JNI interface is a bit cumbersome to use. I would
    not recommend this solution.

    Arne

  7. Re: DEC-BASIC Capablities

    Richard B. Gilbert wrote:
    > Steve Pisani wrote:
    >> 3/ Can a DEC-BASIC program call a Java program ?

    > I don't think so but I'm not really an expert on anything to do with
    > Java. You would probably have to call LIB$SPAWN to create a process to
    > run the Java interpreter.


    The JVM is callable via a C API.

    Arne

  8. Re: DEC-BASIC Capablities

    Bob Koehler wrote:
    > In article <60abd1e3-674d-452f-ad33-2e0ffa83907b@y38g2000hsy.googlegroups.com>, Steve Pisani writes:
    >> 1/ Does DEC-BASIC have commands that allow me to make ODBC calls ? If
    >> so - what do I need to set this up?

    >
    > I might be possible that the ODBC API was written in such a way as
    > not to be directly callable form BASIC, but I doubt it.


    The ODBC API is a classic C API.

    Simple extract from sql.h:

    ....
    typedef short SWORD;
    ....
    typedef SWORD SQLSMALLINT;
    ....
    typedef SQLSMALLINT SQLRETURN;
    ....
    typedef void* SQLHANDLE;
    ....
    typedef SQLHANDLE SQLHENV;
    ....
    SQLRETURN SQL_API SQLAllocEnv(SQLHENV*);
    ....

    Arne

  9. Re: DEC-BASIC Capablities



    Steve Pisani wrote:
    > Hi,
    >
    > I'm relatively new to this environment, so I'm hoping to get some info
    > from this forum.
    >
    > On one side I have an application running on OpenVMS written in DEC-
    > BASIC which maintains RMS files.
    > On the other side I have a relational DB (Cache from InterSystems)
    >
    > The relational DB allows me to extract/update information into it via
    > a number of methods, namely, via ODBC calls, or programs written in C,
    > C++, Java, .NET... and other technologies.
    >
    > The task is to modify the DEC-BASIC information such that I can send
    > data to the relational Database. Whilst I know the capabilities
    > afforded to me by the rdbms side, I do not knwo what capabilities DEC-
    > BASIC has.
    >
    > so -
    >
    > 1/ Does DEC-BASIC have commands that allow me to make ODBC calls ? If
    > so - what do I need to set this up?
    > 2/ Can a DEC-BASIC program call a C++ program ? If so - does this need
    > to be "linked" in with the BASIC object.
    > 3/ Can a DEC-BASIC program call a Java program ?
    >
    > Any feedback appreciated..
    >
    > Thanks
    >
    > Steve


    I have developed a Java to RMS interface that uses VMS Basic to receive
    connections from a Java program. I am currently working on an open
    source version of it but it's not quite ready (in my opinion) to be
    released. In addition to access to RMS files, it has the capability to
    call VMS subprograms. If you are interested I can give you more info.

    Jeff Coffield
    www.digitalsynergyinc.coim

  10. Re: DEC-BASIC Capablities

    Here is an old thing which I posted on this forum years ago. I am not
    sure how applicable it is to the present problem, but it probably shows
    people an idea or two. I am sorry that some of it has
    a CR inserted at an inconvenient column (at least as it appears on my
    screen).
    =============================================
    The following examples of CROSS-CALLS have been extracted from
    Ch. 48 of THE FRESHMAN COMPUTER SKILLS MANUAL, by Prof. Martin Patt of
    University of Mass - Lowell.

    The publisher has given permission for the release of these examples.
    Permission is also granted to publish these examples in whole or in
    part, provided that credit is given to the above listed publication.

    Excerpts from four main programs are presented. Each of the main
    programs call five subprograms. The subprograms are written in
    FORTRAN,
    C, BASIC, Pascal, and MACRO. All of the subprograms do the same three
    things:

    1. They take three integers from the main program, and return
    the sum via the 4th argument.

    2. They take an integer array from the main program, and return
    the third array-element via an argument.

    3. They take an character string from the main program, and
    change
    the middle five characters. The revised string is available
    to the main program via an argument.


    Correspondence of Commonly-Used Data Types On the VAX



    ----------------------------------------------------------------------
    | Bits MACRO C FORTRAN BASIC
    Pascal |

    ----------------------------------------------------------------------
    | |
    | 8 byte char CHARACTER BYTE
    CHAR |
    | CHARACTER*1 BOOLEAN |
    | |

    ----------------------------------------------------------------------
    | |
    | 16 word short int INTEGER*2 WORD
    |
    | |

    ----------------------------------------------------------------------
    | |
    | 32 longword long int INTEGER INTEGER
    INTEGER |
    | REAL LONG UNSIGNED|
    | LOGICAL REAL REAL |
    | INTEGER*4 SINGLE
    SINGLE |
    | REAL*4 |
    | |

    ----------------------------------------------------------------------
    | |
    | 64 double double DOUBLE
    DOUBLE |
    | GFLOAT |
    | REAL*8 |
    | DOUBLE
    PRECISION |
    | |

    ----------------------------------------------------------------------



    8.7 FORTRAN Main Program Calling The Five Subprograms
    (See also ADDENDUM at end of this chapter)

    NOTE: Extracted from FACULTY$DISK:[PATTM.MIXED_LANG]MAIN_FOR.FOR


    integer ia/2/,ib/3/,ic/4/,isum
    integer iarr13/0/, iarray(3,3)/1,2,3,4,5,6,7,8,9/
    character*7 string1/'ABCDEFG'/,string2
    c
    print*,' '
    print*,'FORTRAN MAIN PROGRAM: 2+3+4 = ? 1 4 7 "ABCDEFG"'
    print*,' 2 5 8'
    print*,' 3 6 9'

    c CALLING THE FORTRAN SUBPROGRAM
    string2=string1
    call XYZ_FOR(ia,ib,ic,isum,iarray,iarr13,string2)
    print*,' '
    print*,'FORTRAN subprogram computed sum: ',isum
    print*,'FORTRAN subprogram rcvd 3rd array el:',iarr13
    print*,'FORTRAN subprogram changed the string to: ',string2

    c CALLING THE C-SUBPROGRAM
    string2=string1
    call XYZ_C(ia,ib,ic,isum,iarray,iarr13,%REF(string2))
    print*,' '
    print*,'C subprogram computed sum: ',isum
    print*,'C subprogram rcvd 3rd array el: ',iarr13
    print*,'C subprogram changed the string to: ',string2

    c CALLING THE PASCAL SUBPROGRAM
    string2=string1
    call XYZ_PAS(ia,ib,ic,isum,iarray,iarr13,%REF(string2))
    print*,' '
    print*,'Pascal subprogram computed sum: ',isum
    print*,'Pascal subprogram rcvd 3rd array el: ',iarr13
    print*,'Pascal subprogram changed the string to: ',string2

    c CALLING THE BASIC SUBPROGRAM
    string2=string1
    call XYZ_BAS(ia,ib,ic,isum,iarray,iarr13,string2)
    print*,' '
    print*,'BASIC subprogram computed sum: ',isum
    print*,'BASIC subprogram rcvd 3rd array el: ',iarr13
    print*,'BASIC subprogram changed the string to: ',string2

    c CALLING THE MACRO SUBPROGRAM
    string2=string1
    call XYZ_MAR(ia,ib,ic,isum,iarray,iarr13,%REF(string2))
    print*,' '
    print*,'MACRO subprogram computed sum: ',isum
    print*,'MACRO subprogram rcvd 3rd array el: ',iarr13
    print*,'MACRO subprogram changed the string to: ',string2




    8.8 C Main Program Calling The Five Subprograms

    NOTE: Extracted from FACULTY$DISK:[PATTM.MIXED_LANG]MAIN_C.C


    #include
    struct {int length; char *string;} chstring;
    char sample_chstring[]="ABCDEFG";
    int a=2,b=3,c=4,sum=0,iarr3=0,
    iarray[][3]={{ 1, 4, 7},
    { 2, 5, 8},
    { 3, 6, 9}};

    printf("\n\nC - MAIN PROGRAM: 2+3+4 = ?\t1 4 7\t 'ABCDEFG'");
    printf( "\n \t2 5 8");
    printf( "\n \t3 6 9");

    /*CALLING THE C SUBPROGRAM*/
    xyz_c(&a,&b,&c,&sum,iarray,&iarr3,sample_chstring);
    printf("\n\nC-subprogram computes: %d",sum);
    printf(" \nC-subprogram finds 3rd el: %d",iarr3);
    printf( "\nC-subprogram changed the string to: %s",
    sample_chstring);
    /*CALLING THE FORTRAN SUBPROGRAM*/
    chstring.length=strlen(sample_chstring);
    chstring.string=sample_chstring;
    xyz_for(&a,&b,&c,&sum,iarray,&iarr3,&chstring);
    printf("\n\nFORTRAN subprogram computes: %d",sum);
    printf( "\nFORTRAN subprogram finds 3rd el: %d",iarr3);
    printf( "\nFORTRAN subprogram changed the string to: %s",
    chstring.string);
    /*CALLING THE PASCAL SUBPROGRAM*/
    xyz_pas(&a,&b,&c,&sum,iarray,&iarr3,sample_chstring);
    printf("\n\nPascal subprogram computes: %d",sum);
    printf( "\nPascal subprogram finds 3rd el: %d",iarr3);
    printf( "\nPascal subprogram changed the string to: %s",
    sample_chstring);
    /*CALLING THE BASIC SUBPROGRAM*/
    chstring.length=strlen(sample_chstring);
    chstring.string=sample_chstring;
    xyz_bas(&a,&b,&c,&sum,iarray,&iarr3,&chstring);
    printf("\n\nBASIC subprogram computes: %d",sum);
    printf( "\nBASIC subprogram finds 3rd el: %d",iarr3);
    printf( "\nBASIC subprogram changed the string to: %s",
    chstring.string);
    /*CALLING THE MACRO SUBPROGRAM*/
    xyz_mar(&a,&b,&c,&sum,iarray,&iarr3,sample_chstring);
    printf("\n\nMACRO subprogram computes: %d",sum);
    printf(" \nMACRO subprogram finds 3rd el: %d",iarr3);
    printf( "\nMACRO subprogram changed the string to: %s",
    sample_chstring);
    printf("\n\n");




    8.9 BASIC Main Program Calling The Five Subprograms

    NOTE: Extracted from FACULTY$DISK:[PATTM.MIXED_LANG]MAIN_BAS.BAS

    DECLARE INTEGER A,B,C,SUM
    DECLARE INTEGER IARR3
    DIMENSION long IARRAY(2%,2%) ! Declare IARRAY[3x3]
    declare string STRING1,STRING2

    A=2% \B=3% \C=4% \STRING1='ABCDEFG'

    IARRAY(0,0)=1 \IARRAY(0,1)=4 \IARRAY(0,2)=7
    IARRAY(1,0)=2 \IARRAY(1,1)=5 \IARRAY(1,2)=8
    IARRAY(2,0)=3 \IARRAY(2,1)=6 \IARRAY(2,2)=9

    PRINT 'BASIC main program: 2+3+4 = ? 1 4 7 "ABCDEFG"'
    PRINT ' 2 5 8'
    PRINT ' 3 6 9'

    ! CALLING THE BASIC SUBPROGRAM
    STRING2=STRING1
    CALL XYZ_BAS(A,B,C,SUM,IARRAY(0%,0%) by ref,IARR3,STRING2)
    PRINT
    PRINT 'BASIC subprogram computed sum: ',SUM
    PRINT 'BASIC subprogram rcvd 3rd array el: ',IARR3
    PRINT 'BASIC subprogram changed the string to: ',STRING2

    ! CALLING THE FORTRAN SUBPROGRAM
    STRING2=STRING1
    CALL XYZ_FOR(A,B,C,SUM,IARRAY(0%,0%) by ref,IARR3,STRING2)
    PRINT
    PRINT 'FORTRAN subprogram computed sum: ',SUM
    PRINT 'FORTRAN subprogram rcvd 3rd array el:',IARR3
    PRINT 'FORTRAN subprogram changed the string to: ',STRING2

    ! CALLING THE C-SUBPROGRAM
    STRING2=STRING1
    CALL XYZ_C(A,B,C,SUM,IARRAY(0%,0%) by ref,IARR3,STRING2 by ref)
    PRINT
    PRINT 'C subprogram computed sum: ',SUM
    PRINT 'C subprogram rcvd 3rd array el: ',IARR3
    PRINT 'C subprogram changed the string to: ',STRING2

    ! CALLING THE PASCAL SUBPROGRAM
    STRING2=STRING1
    CALL XYZ_PAS(A,B,C,SUM,IARRAY(0%,0%) by ref,IARR3,STRING2 by ref)
    PRINT
    PRINT 'Pascal subprogram computed sum: ',SUM
    PRINT 'Pascal subprogram rcvd 3rd array el: ',IARR3
    PRINT 'Pascal subprogram changed the string to: ',STRING2

    ! CALLING THE MACRO SUBPROGRAM
    STRING2=STRING1
    CALL XYZ_MAR(A,B,C,SUM,IARRAY(0%,0%) by ref,IARR3,STRING2 by ref)
    PRINT
    PRINT 'MACRO subprogram computed sum: ',SUM
    PRINT 'MACRO subprogram rcvd 3rd array el: ',IARR3
    PRINT 'MACRO subprogram changed the string to: ',STRING2




    8.10 Pascal Main Program Calling The Five Subprograms

    NOTE: Extracted from FACULTY$DISK:[PATTM.MIXED_LANG]MAIN_PAS.PAS


    (*================================================ =====================

    GLOBAL DECLARATIONS

    ================================================== ===================*)
    TYPE I9 = ARRAY[0..2, 0..2] OF INTEGER;
    CH7 = ARRAY[0..6] OF CHAR;
    STRING_ARG = RECORD LENGTH:INTEGER; ADDRS:^CH7; END;
    (*================================================ =====================

    DECLARATION OF EXTERNAL PROCEDURES

    ================================================== ===================*)
    procedure XYZ_PAS(VAR A,B,C,SUM:INTEGER;IARRAY:I9;VAR IARR3:INTEGER;
    VAR CHS:CH7);
    extern;
    procedure XYZ_FOR(VAR A,B,C,SUM:INTEGER;IARRAY:I9;VAR IARR3:INTEGER;
    VAR CHSTRING:STRING_ARG);
    extern;
    procedure XYZ_BAS(VAR A,B,C,SUM:INTEGER;IARRAY:I9;VAR IARR3:INTEGER;
    VAR CHSTRING:STRING_ARG);
    extern;
    procedure XYZ_C(VAR A,B,C,SUM:INTEGER;IARRAY:I9;VAR IARR3:INTEGER;
    VAR CHS:CH7);
    extern;
    procedure XYZ_MAR(VAR A,B,C,SUM:INTEGER;IARRAY:I9;VAR IARR3:INTEGER;
    VAR CHS:CH7);
    extern;
    (*================================================ =====================

    THE PROCEDURE WHICH CALLS THE FIVE SUBPROGRAMS

    ================================================== ===================*)
    procedure proc_TST(VAR out:TEXT);
    VAR a,b,c,sum,iarr3 :INTEGER;
    iarray :I9;
    CHSTRING :STRING_ARG;
    CHS :CH7;
    BEGIN
    NEW(CHSTRING.ADDRS);
    a:=2; b:=3; c:=4; sum:=-1; iarr3:=-1;
    iarray[0,0]:=1; iarray[0,1]:=4; iarray[0,2]:=7;
    iarray[1,0]:=2; iarray[1,1]:=5; iarray[1,2]:=8;
    iarray[2,0]:=3; iarray[2,1]:=6; iarray[2,2]:=9;

    CHSTRING.LENGTH:=7;
    CHSTRING.ADDRS^[0]:= 'A'; CHSTRING.ADDRS^[4]:= 'E';
    CHSTRING.ADDRS^[1]:= 'B'; CHSTRING.ADDRS^[5]:= 'F';
    CHSTRING.ADDRS^[2]:= 'C'; CHSTRING.ADDRS^[6]:= 'G';
    CHSTRING.ADDRS^[3]:= 'D';

    CHS[0]:='A'; CHS[1]:='B'; CHS[2]:='C'; CHS[3]:='D';
    CHS[4]:='E'; CHS[5]:='F'; CHS[6]:='G';

    writeln(out);
    writeln(out);
    writeln(out,'Pascal - Main Program: 2+3+4 = ? 1 4 7 "ABCDEFG"');
    writeln(out,' 2 5 8');
    writeln(out,' 3 6 9');

    (*CALLING THE PASCAL SUBPROGRAM*)
    XYZ_PAS(a,b,c,sum,iarray,iarr3,CHS);
    writeln(out);
    writeln(out,'Pascal subprogram computes: ',sum);
    writeln(out,'Pascal subprogram found 3rd array element: ',iarr3);
    writeln(out,'Pascal subprogram changed the string to: ',
    CHS[0],CHS[1],CHS[2],CHS[3],CHS[4],CHS[5],CHS[6]);

    (*CALLING THE FORTRAN SUBPROGRAM*)
    XYZ_FOR(a,b,c,sum,iarray,iarr3,CHSTRING);
    writeln(out);
    writeln(out,'FORTRAN subprogram computes: ',sum);
    writeln(out,'FORTRAN subprogram found 3rd array element:',iarr3);
    writeln(out,'FORTRAN subprogram changed the string to: ',
    CHSTRING.ADDRS^[0],CHSTRING.ADDRS^[1],CHSTRING.ADDRS^[2],
    CHSTRING.ADDRS^[3],CHSTRING.ADDRS^[4],CHSTRING.ADDRS^[5],
    CHSTRING.ADDRS^[6]);

    (*CALLING THE BASIC SUBPROGRAM*)
    XYZ_BAS(a,b,c,sum,iarray,iarr3,CHSTRING);
    writeln(out);
    writeln(out,'BASIC subprogram computes: ',sum);
    writeln(out,'BASIC subprogram found 3rd array element: ',iarr3);
    writeln(out,'BASIC subprogram changed the string to: ',
    CHSTRING.ADDRS^[0],CHSTRING.ADDRS^[1],CHSTRING.ADDRS^[2],
    CHSTRING.ADDRS^[3],CHSTRING.ADDRS^[4],CHSTRING.ADDRS^[5],
    CHSTRING.ADDRS^[6]);

    (*CALLING THE C SUBPROGRAM*)
    XYZ_C(a,b,c,sum,iarray,iarr3,CHS);
    writeln(out);
    writeln(out,'C-subprogram computes: ',sum);
    writeln(out,'C-subprogram found 3rd array element: ',iarr3);
    writeln(out,'C-subprogram changed the string to: ',
    CHS[0],CHS[1],CHS[2],CHS[3],CHS[4],CHS[5],CHS[6]);

    (*CALLING THE MACRO SUBPROGRAM*)
    XYZ_MAR(a,b,c,sum,iarray,iarr3,CHS);
    writeln(out);
    writeln(out,'MACRO subprogram computes: ',sum);
    writeln(out,'MACRO subprogram found 3rd array element: ',iarr3);
    writeln(out,'MACRO subprogram changed the string to: ',
    CHS[0],CHS[1],CHS[2],CHS[3],CHS[4],CHS[5],CHS[6]);

    END(*proc_TST*);




    8.11 The Five Subprograms: XYZ_FOR, XYZ_C, XYZ_BAS, XYZ_PAS, XYZ_MAR

    These five subprograms were separately compiled to produce five object
    files which were then linked (as a group) to each of the main
    programs.


    8.11.1 The External FORTRAN Subroutine

    Reference: FACULTY$DISK:[PATTM.MIXED_LANG]SUB_FOR.FOR

    SUBROUTINE XYZ_FOR(i1,i2,i3,isum,iarray,iarr3,string)
    DIMENSION iarray(1)
    CHARACTER*(*) string
    isum=i1+i2+i3
    iarr3=iarray(3)
    string(2:6)='.FOR.'
    return
    end


    8.11.2 The External C Function

    Reference: FACULTY$DISK:[PATTM.MIXED_LANG]SUB_C.C

    void xyz_c(pa,pb,pc,psum,array,parr3,pstring)
    int *pa,*pb,*pc,*psum,*array,*parr3;
    char *pstring;
    {
    *psum=(*pa)+(*pb)+(*pc);
    *parr3=(*(array+2));
    pstring[1]='.'; pstring[2]='.'; pstring[3]='C';
    pstring[4]='.'; pstring[5]='.';
    return;
    }


    8.11.3 The External BASIC Subroutine

    Reference: FACULTY$DISK:[PATTM.MIXED_LANG]SUB_BAS.BAS

    SUB XYZ_BAS(long A,long B,long C,long SUM,long IARRAY(8%) by ref, &
    long IARR3, string CHSTRING)
    SUM = A+B+C
    IARR3 = IARRAY(2)
    CHSTRING = SEG$(CHSTRING,1,1) + '.BAS.' + SEG$(CHSTRING,7,7)
    END SUB


    8.11.4 The External Pascal Procedure

    Reference: FACULTY$DISK:[PATTM.MIXED_LANG]SUB_PAS.PAS

    MODULE WXYZ(INPUT,OUTPUT);
    TYPE I9 = ARRAY[1..9] OF INTEGER;
    TYPE CH7= ARRAY[1..7] OF CHAR;
    [global]
    procedure XYZ_PAS(VAR A,B,C,SUM:INTEGER; VAR IARRAY:I9;
    VAR ARR3:INTEGER; VAR STR:CH7);
    BEGIN
    SUM:=A+B+C;
    ARR3:=IARRAY[3];
    STR[2]:='.'; STR[3]:='P'; STR[4]:='A'; STR[5]:='S'; STR[6]:='.';
    END;
    END.


    8.11.5 The External MACRO Routine
    (See also ADDENDUM below)

    Reference: FACULTY$DISK:[PATTM.MIXED_LANG]SUB_MAR.MAR

    xyz_mar:: .word ^M
    addl3 @4(ap),@8(ap),r2 ; r2 <-- i1 + i2
    addl3 r2,@12(ap),@16(ap) ; sum <-- i1 + i2 + i3

    addl3 #8,20(ap),r2 ; r2 <-- pointer to iarray(3)
    movl (r2),@24(ap) ; iarr3 <-- iarray(3)

    movl 28(ap),r2 ; r2 <-- pointer to string
    movb #46,1(r2) ; "."
    movb #77,2(r2) ; "M"
    movb #65,3(r2) ; "A"
    movb #82,4(r2) ; "R"
    movb #46,5(r2) ; "."

    ret
    .end

    ================================================== =============================
    ADDENDUM FROM USENET (copied by Brendan Welch; thanks, Arne):
    > Does anyone out there have a small example of calling a MACRO routine

    from a
    > FORTRAN program that they would be willing to pass along to me?
    > (preferably one that returns a value from the subroutine)


    You are not very specific about what you want or what your problem is, but
    here is a small example:

    PROGRAM Z
    INTEGER*4 I1,I2,I3
    INTEGER*4 ZZ,ZZZ
    I1=11
    I3=ZZ(I1,I2)
    WRITE(*,*) I1,I2,I3
    I1=11
    I3=ZZZ(I1,I2)
    WRITE(*,*) I1,I2,I3
    END
    C
    INTEGER*4 FUNCTION ZZZ(I,J)
    INTEGER*4 I,J
    J=4*I
    ZZZ=2*I
    RETURN
    END

    .title zz
    .psect $CODE quad,pic,con,lcl,shr,exe,nowrt
    .entry zz,^m<>
    mull3 #4,@4(ap),@8(ap)
    mull3 #2,@4(ap),r0
    ret
    .end


    Hope it helps !

    Arne

    Arne Vajh°j local DECNET: KO::ARNE
    Computer Department PSI:
    PSI%238310013040::ARNE
    Business School of Southern Denmark Internet: ARNE@KO.HHS.DK

  11. Re: DEC-BASIC Capablities

    On 28 Apr, 15:21, Steve Pisani wrote:
    > Hi,
    >
    > I'm relatively new to this environment, so I'm hoping to get some info
    > from this forum.
    >
    > On one side I have an application running on OpenVMS written in DEC-
    > BASIC which maintains RMS files.
    > On the other side I have a relational DB (Cache from InterSystems)
    >
    > The relational DB allows me to extract/update information into it via
    > a number of methods, namely, via ODBC calls, or programs written in C,
    > C++, Java, .NET... and other technologies.
    >
    > The task is to modify the DEC-BASIC information such that I can send
    > data to the relational Database. Whilst I know the capabilities
    > afforded to me by the rdbms side, I do not knwo what capabilities DEC-
    > BASIC has.
    >
    > so -
    >
    > 1/ Does DEC-BASIC have commands that allow me to make ODBC calls ? If
    > so - what do I need to set this up?
    > 2/ Can a DEC-BASIC program call a C++ program ? If so - does this need
    > to be "linked" in with the BASIC object.
    > 3/ Can a DEC-BASIC program call a Java program ?
    >
    > Any feedback appreciated..
    >
    > Thanks
    >
    > Steve


    Hiya,

    Welcome to the environment Steve.

    I've a feeling that CONNX may be able to help with the job that you
    want to do almost out of the box. I've not used it, but a number of
    people I've spoken to have.
    I think their website's www.connx-net.com

    Steve

  12. Re: DEC-BASIC Capablities

    On Apr 30, 4:41*am, etmsr...@yahoo.co.uk wrote:
    > On 28 Apr, 15:21, Steve Pisani wrote:
    >
    >
    >
    >
    >
    > > Hi,

    >
    > > I'm relatively new to this environment, so I'm hoping to get some info
    > > from this forum.

    >
    > > On one side I have an application running on OpenVMS written in DEC-
    > > BASIC which maintains RMS files.
    > > On the other side I have a relational DB (Cache from InterSystems)

    >
    > > The relational DB allows me to extract/update information into it via
    > > a number of methods, namely, via ODBC calls, or programs written in C,
    > > C++, Java, .NET... and other technologies.

    >
    > > The task is to modify the DEC-BASIC information such that I can send
    > > data to the relational Database. Whilst I know the capabilities
    > > afforded to me by the rdbms side, I do not knwo what capabilities DEC-
    > > BASIC has.

    >
    > > so -

    >
    > > 1/ Does DEC-BASIC have commands that allow me to make ODBC calls ? If
    > > so - what do I need to set this up?
    > > 2/ Can a DEC-BASIC program call a C++ program ? If so - does this need
    > > to be "linked" in with the BASIC object.
    > > 3/ Can a DEC-BASIC program call a Java program ?

    >
    > > Any feedback appreciated..

    >
    > > Thanks

    >
    > > Steve

    >
    > Hiya,
    >
    > Welcome to the environment Steve.
    >
    > I've a feeling that CONNX may be able to help with the job that you
    > want to do almost out of the box. *I've not used it, but a number of
    > people I've spoken to have.
    > I think their website'swww.connx-net.com
    >
    > Steve- Hide quoted text -
    >
    > - Show quoted text -


    Or alternatively,

    http://www.connx.com/products/open_vms.asp
    http://www.connx.com/products/rms.html

    http://www.attunity.com/rms_data_access


    Neil Rieck
    Kitchener/Waterloo/Cambridge,
    Ontario, Canada.
    http://www3.sympatico.ca/n.rieck/lin...l_openvms.html

  13. Re: DEC-BASIC Capablities

    On Apr 30, 6:27 am, Neil Rieck wrote:
    > On Apr 30, 4:41 am, etmsr...@yahoo.co.uk wrote:
    >
    >
    >
    > > On 28 Apr, 15:21, Steve Pisani wrote:

    >
    > > > Hi,

    >
    > > > I'm relatively new to this environment, so I'm hoping to get some info
    > > > from this forum.

    >
    > > > On one side I have an application running on OpenVMS written in DEC-
    > > > BASIC which maintains RMS files.
    > > > On the other side I have a relational DB (Cache from InterSystems)

    >
    > > > The relational DB allows me to extract/update information into it via
    > > > a number of methods, namely, via ODBC calls, or programs written in C,
    > > > C++, Java, .NET... and other technologies.

    >
    > > > The task is to modify the DEC-BASIC information such that I can send
    > > > data to the relational Database. Whilst I know the capabilities
    > > > afforded to me by the rdbms side, I do not knwo what capabilities DEC-
    > > > BASIC has.

    >
    > > > so -

    >
    > > > 1/ Does DEC-BASIC have commands that allow me to make ODBC calls ? If
    > > > so - what do I need to set this up?
    > > > 2/ Can a DEC-BASIC program call a C++ program ? If so - does this need
    > > > to be "linked" in with the BASIC object.
    > > > 3/ Can a DEC-BASIC program call a Java program ?

    >
    > > > Any feedback appreciated..

    >
    > > > Thanks

    >
    > > > Steve

    >
    > > Hiya,

    >
    > > Welcome to the environment Steve.

    >
    > > I've a feeling that CONNX may be able to help with the job that you
    > > want to do almost out of the box. I've not used it, but a number of
    > > people I've spoken to have.
    > > I think their website'swww.connx-net.com

    >
    > > Steve- Hide quoted text -

    >
    > > - Show quoted text -

    >
    > Or alternatively,
    >
    > http://www.connx.com/products/open_v...ducts/rms.html
    >
    > http://www.attunity.com/rms_data_access
    >


    Our team was to investigate and evaluate Connx as a reporting solution
    for GTE Wireless (not yet Verizon).
    It was literally amazing. It was much more than we needed, though, and
    there were voices from above (no, not a heavenly choir of angels, but
    whispers of middle management) basically telling us "Choose IQ, choose
    IQ". Not sure if you are familiar with IQ, the ad-hoc reporting tool.
    It was much less powerful. Connx brought the data to your desktop, in
    many different forms. IQ left it on VMS where you could see it in a
    terminal window as nothing but characters or reports...



  14. Re: DEC-BASIC Capablities

    In article <48166bae$0$90275$14726298@news.sunsite.dk>, =?ISO-8859-1?Q?Arne_Vajh=F8j?= writes:
    >
    > The ODBC API is a classic C API.
    >
    > Simple extract from sql.h:
    >
    > ...
    > typedef short SWORD;
    > ...
    > typedef SWORD SQLSMALLINT;
    > ...
    > typedef SQLSMALLINT SQLRETURN;
    > ...
    > typedef void* SQLHANDLE;
    > ...
    > typedef SQLHANDLE SQLHENV;
    > ...
    > SQLRETURN SQL_API SQLAllocEnv(SQLHENV*);
    > ...


    Nothing there that I couldn't do in every native language I've used
    on VMS. I haven't used BASIC, but I think all the inter-language
    hooks are in the compiler like I'm used to in Fortran (changing
    passing techniques and such).


  15. Re: DEC-BASIC Capablities

    Jan-Erik S÷derholm wrote:
    > [snip]
    > Are you talking about ODBC calls from say a Windows environment ?
    > Or local ODBC calls on the VMS system ?


    I'm thinking he meant the latter.

    D.J.D.

  16. Re: DEC-BASIC Capablities

    Bob Koehler wrote:
    > In article <48166bae$0$90275$14726298@news.sunsite.dk>, =?ISO-8859-1?Q?Arne_Vajh=F8j?= writes:
    >> The ODBC API is a classic C API.
    >>
    >> Simple extract from sql.h:
    >>
    >> ...
    >> typedef short SWORD;
    >> ...
    >> typedef SWORD SQLSMALLINT;
    >> ...
    >> typedef SQLSMALLINT SQLRETURN;
    >> ...
    >> typedef void* SQLHANDLE;
    >> ...
    >> typedef SQLHANDLE SQLHENV;
    >> ...
    >> SQLRETURN SQL_API SQLAllocEnv(SQLHENV*);
    >> ...

    >
    > Nothing there that I couldn't do in every native language I've used
    > on VMS. I haven't used BASIC, but I think all the inter-language
    > hooks are in the compiler like I'm used to in Fortran (changing
    > passing techniques and such).


    I think so too.

    http://h71000.www7.hp.com/doc/82fina....html#rtl_chap

    Arne

+ Reply to Thread