Skip to main content

We are in the process of converting a native application to COBOL .NET and I would like to know a couple of things

  1. Is the use of SQLDA supported in COBOL .NET?
  2. If so then do I still need to set the address of sqldata(n) to a group entry as per below and process in 64k chunks or is there a better (easier) way?

01 obj-entry.

   03 obj-len     pic s9(9) comp-5.

   03 obj-str      pic x(65535).

Ideally I would like to utilise a type String field but, as I have learnt, you cannot use ADDRESS OF on a native managed type so hoping for alternatives

Thanks



------------------------------
Peter Restorick

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

We are in the process of converting a native application to COBOL .NET and I would like to know a couple of things

  1. Is the use of SQLDA supported in COBOL .NET?
  2. If so then do I still need to set the address of sqldata(n) to a group entry as per below and process in 64k chunks or is there a better (easier) way?

01 obj-entry.

   03 obj-len     pic s9(9) comp-5.

   03 obj-str      pic x(65535).

Ideally I would like to utilise a type String field but, as I have learnt, you cannot use ADDRESS OF on a native managed type so hoping for alternatives

Thanks



------------------------------
Peter Restorick

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

Hi Peter,

Dynamic SQL using SQLDA is supported when using ADO under .NET managed COBOL but as far as I know it has not been enhanced for use with a larger SQLDA area.

The copyfile for sqlda still contains a max occurs of 1489 times:

 01 SQLDA sync.
    05 SQLDAID               PIC X(8)  VALUE "SQLDA  ".
    05 SQLDABC               PIC S9(9) COMP-5 value 0.
    05 SQLN                  PIC S9(4) COMP-5 value 0.
    05 SQLD                  PIC S9(4) COMP-5 value 0.
    05 SQLVAR OCCURS 0 TO 1489 TIMES DEPENDING ON SQLD.
       10 SQLTYPE            PIC S9(4) COMP-5.
       10 SQLLEN             PIC S9(4) COMP-5.
$IF P64 SET
       *> For 64-bit environments, ensure that SQLDATA is
       *> aligned on an 8-byte boundary.
       10 FILLER             PIC S9(9) COMP-5.
$END
       10 SQLDATA            USAGE POINTER.
       10 SQLIND             USAGE POINTER.
       10 SQLNAME.
          15 SQLNAMEL        PIC S9(4) COMP-5.
          15 SQLNAMEC        PIC X(30).



------------------------------
Chris Glazier
Principal Technical Support Specialist
Rocket Forum Shared Account
------------------------------

Hi Peter,

Dynamic SQL using SQLDA is supported when using ADO under .NET managed COBOL but as far as I know it has not been enhanced for use with a larger SQLDA area.

The copyfile for sqlda still contains a max occurs of 1489 times:

 01 SQLDA sync.
    05 SQLDAID               PIC X(8)  VALUE "SQLDA  ".
    05 SQLDABC               PIC S9(9) COMP-5 value 0.
    05 SQLN                  PIC S9(4) COMP-5 value 0.
    05 SQLD                  PIC S9(4) COMP-5 value 0.
    05 SQLVAR OCCURS 0 TO 1489 TIMES DEPENDING ON SQLD.
       10 SQLTYPE            PIC S9(4) COMP-5.
       10 SQLLEN             PIC S9(4) COMP-5.
$IF P64 SET
       *> For 64-bit environments, ensure that SQLDATA is
       *> aligned on an 8-byte boundary.
       10 FILLER             PIC S9(9) COMP-5.
$END
       10 SQLDATA            USAGE POINTER.
       10 SQLIND             USAGE POINTER.
       10 SQLNAME.
          15 SQLNAMEL        PIC S9(4) COMP-5.
          15 SQLNAMEC        PIC X(30).



------------------------------
Chris Glazier
Principal Technical Support Specialist
Rocket Forum Shared Account
------------------------------

Thanks Chris appreciate the response.

We have changed our connection to ADO (from ODBC) and it seems to be hanging together quite nicely apart from the (max) type columns which I am struggling with at present. 

In the long run I suspect that, on our side, we will change the dynamic SQL processes to using datasets instead of SQLDA but that is awhile down the road.

Regards



------------------------------
Peter Restorick
Mr
Rocket Software Forum Member
------------------------------