Skip to content

Commit

Permalink
v1.0.11b
Browse files Browse the repository at this point in the history
- Fixed "More formats for connect" (#43)
- Fixed "length/power issues with COMP-3 (#92)" (and zoned TC/LS)
- Fixed "pass postgres cast operator as token (#93)"
- Fixed "Long queries break COBOL compiler" (#89)
- Fixed (partially) "GixSQL 1.0.9 compiler warnings" (#53)
- Fixed a couple of regressions for "support EXEC SQL VAR" (#47)
- Fixed "add OCCURS UNBOUNDED (#80)
  • Loading branch information
mridoni committed Apr 5, 2022
1 parent 61349a5 commit a6fc97c
Show file tree
Hide file tree
Showing 39 changed files with 2,724 additions and 116 deletions.
81 changes: 81 additions & 0 deletions deploy/installers/linux/gixsql-test/TSQL006B.cbl
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
IDENTIFICATION DIVISION.

PROGRAM-ID. TSQL006B.


ENVIRONMENT DIVISION.

CONFIGURATION SECTION.
SOURCE-COMPUTER. IBM-AT.
OBJECT-COMPUTER. IBM-AT.
INPUT-OUTPUT SECTION.
FILE-CONTROL.

DATA DIVISION.

FILE SECTION.

WORKING-STORAGE SECTION.

01 DATASRC PIC X(64).
01 DBUSR PIC X(64).

01 S-SQLCOMMAND.
03 S-SQLCOMMAND-LEN PIC S9(8) COMP-5.
03 S-SQLCOMMAND-ARR PIC X(250).

EXEC SQL
INCLUDE SQLCA
END-EXEC.

PROCEDURE DIVISION.

000-CONNECT.

DISPLAY "DATASRC" UPON ENVIRONMENT-NAME.
ACCEPT DATASRC FROM ENVIRONMENT-VALUE.
DISPLAY "DATASRC_USR" UPON ENVIRONMENT-NAME.
ACCEPT DBUSR FROM ENVIRONMENT-VALUE.

DISPLAY '***************************************'.
DISPLAY " DATASRC : " DATASRC.
DISPLAY " AUTH : " DBUSR.
DISPLAY '***************************************'.

EXEC SQL
CONNECT TO :DATASRC USER :DBUSR
END-EXEC.

IF SQLCODE <> 0 THEN
DISPLAY 'CONNECT SQLCODE. ' SQLCODE
DISPLAY 'CONNECT SQLERRM. ' SQLERRM
GO TO 100-EXIT
END-IF.

100-MAIN.

EXEC SQL START TRANSACTION END-EXEC.

MOVE EXEC-SQLCOMMAND TO S-SQLCOMMAND-ARR.
MOVE FUNCTION LENGTH(FUNCTION TRIM(S-SQLCOMMAND-ARR))
TO S-SQLCOMMAND-LEN.

EXEC SQL AT :DBS
PREPARE P1 FROM :S-SQLCOMMAND
END-EXEC.

EXEC SQL COMMIT END-EXEC.

EXEC SQL
CONNECT RESET
END-EXEC.

IF SQLCODE <> 0 THEN
DISPLAY 'DISCONNECT SQLCODE. ' SQLCODE
DISPLAY 'DISCONNECT SQLERRM. ' SQLERRM
GO TO 100-EXIT
END-IF.

100-EXIT.
STOP RUN.
98 changes: 98 additions & 0 deletions deploy/installers/linux/gixsql-test/TSQL006C.cbl
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
IDENTIFICATION DIVISION.

PROGRAM-ID. TSQL006C.


ENVIRONMENT DIVISION.

CONFIGURATION SECTION.
SOURCE-COMPUTER. IBM-AT.
OBJECT-COMPUTER. IBM-AT.
INPUT-OUTPUT SECTION.
FILE-CONTROL.

DATA DIVISION.

FILE SECTION.

WORKING-STORAGE SECTION.

01 DATASRC PIC X(64).
01 DBUSR PIC X(64).

01 EXEC-SQLCOMMAND PIC X(100) VALUE 'SELECT 1'.

01 S-SQLCOMMAND.
49 S-SQLCOMMAND-LEN PIC S9(8) COMP-5.
49 S-SQLCOMMAND-ARR PIC X(250).

01 S-SQLCOMMAND-2 PIC X(250).

01 S-SQLCOMMAND-3.
03 S-SQLCOMMAND-3-LEN PIC S9(8) COMP-5.
03 S-SQLCOMMAND-3-ARR PIC X(250).


EXEC SQL
INCLUDE SQLCA
END-EXEC.

PROCEDURE DIVISION.

000-CONNECT.

DISPLAY "DATASRC" UPON ENVIRONMENT-NAME.
ACCEPT DATASRC FROM ENVIRONMENT-VALUE.
DISPLAY "DATASRC_USR" UPON ENVIRONMENT-NAME.

ACCEPT DBUSR FROM ENVIRONMENT-VALUE.
DISPLAY '***************************************'.
DISPLAY " DATASRC : " DATASRC.
DISPLAY " AUTH : " DBUSR.
DISPLAY '***************************************'.

EXEC SQL
CONNECT TO :DATASRC USER :DBUSR
END-EXEC.

IF SQLCODE <> 0 THEN
DISPLAY 'CONNECT SQLCODE. ' SQLCODE
DISPLAY 'CONNECT SQLERRM. ' SQLERRM
GO TO 100-EXIT
END-IF.

100-MAIN.

EXEC SQL START TRANSACTION END-EXEC.

MOVE EXEC-SQLCOMMAND TO S-SQLCOMMAND-ARR.
MOVE FUNCTION LENGTH(FUNCTION TRIM(S-SQLCOMMAND-ARR))
TO S-SQLCOMMAND-LEN.

EXEC SQL
PREPARE P1 FROM :S-SQLCOMMAND
END-EXEC.

EXEC SQL
PREPARE P2 FROM :S-SQLCOMMAND-2
END-EXEC.

EXEC SQL
PREPARE P2 FROM :S-SQLCOMMAND-3-ARR
END-EXEC.

EXEC SQL COMMIT END-EXEC.

EXEC SQL
CONNECT RESET
END-EXEC.

IF SQLCODE <> 0 THEN
DISPLAY 'DISCONNECT SQLCODE. ' SQLCODE
DISPLAY 'DISCONNECT SQLERRM. ' SQLERRM
GO TO 100-EXIT
END-IF.

100-EXIT.
STOP RUN.
9 changes: 9 additions & 0 deletions deploy/installers/linux/gixsql-test/TSQL007A.cbl
Original file line number Diff line number Diff line change
Expand Up @@ -440,8 +440,17 @@
041600 COMP-FOOT-EXIT.
041700 EXIT.
041800

035800 DO-FILE SECTION.

035800*DO-WORKING-STORAGE SECTION.

035800 DO-LINKAGE SECTION.

041900 END DECLARATIVES.
042000


042100 000-INITIATE.
042200
042300 OPEN INPUT PAYROLL-REGISTER-DATA,
Expand Down
14 changes: 14 additions & 0 deletions deploy/installers/linux/gixsql-test/TSQL012A.cbl
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@

01 T1 PIC 9(3) VALUE 0.
01 TABROWID PIC 9(8) VALUE 0.
01 DESCRIPTOR PIC 9(8) VALUE 0.
01 OID PIC 9(8) VALUE 0.
01 LEN PIC 9(8) VALUE 0.
01 RES PIC 9(8) VALUE 0.

EXEC SQL
INCLUDE SQLCA
Expand Down Expand Up @@ -70,6 +74,16 @@
REFNR = :T1)
END-EXEC.

* EXEC SQL
* SELECT LEN INTO :LEN FROM TAB WHERE OID=:OID
* END-EXEC.
*
* EXEC SQL
* SELECT lo_close (:DESCRIPTOR) INTO :RES
* FROM TAB
* WHERE OID=:OID
* END-EXEC.


DISPLAY 'SELECT SQLCODE: ' SQLCODE.
IF SQLCODE <> 0 THEN
Expand Down
23 changes: 19 additions & 4 deletions deploy/installers/linux/gixsql-test/TSQL015A.cbl
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@
WORKING-STORAGE SECTION.

EXEC SQL
INCLUDE EMPREC
END-EXEC.

01 DATASRC PIC X(64).
01 DBS PIC X(64).
01 DBUSR PIC X(64).
01 DBPWD PIC X(64).

01 Z-MY-ELEMENTS PIC 9(8).

78 MY-CONSTANT VALUE 16.

EXEC SQL
INCLUDE SQLCA
END-EXEC.
Expand All @@ -39,7 +39,22 @@
05 FILLER OCCURS UNBOUNDED
DEPENDING ON L-DYNBUFFER-LEN
PIC X.
01 L-DYNBUFFER.
05 FILLER OCCURS 0 TO MY-CONSTANT TIMES
DEPENDING ON L-DYNBUFFER-LEN
PIC X.

01 MY-TAB.
05 MY-NO PIC 9(009) COMP-5 VALUE ZERO.
05 MY-TAB-CACHE OCCURS 100
DEPENDING ON Z-MY-ELEMENTS
ASCENDING KEY IS MY-ID
INDEXED BY I-TAB.
07 MY-ELEMENT.
10 MY-ID PIC 9(009) COMP-5 VALUE ZERO.
10 MY-DATA PIC X(02189) VALUE SPACE.

PROCEDURE DIVISION.

000-CONNECT.
Expand Down
126 changes: 126 additions & 0 deletions deploy/installers/linux/gixsql-test/TSQL018A.cbl
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
IDENTIFICATION DIVISION.

PROGRAM-ID. TSQL018A.


ENVIRONMENT DIVISION.

CONFIGURATION SECTION.
SOURCE-COMPUTER. IBM-AT.
OBJECT-COMPUTER. IBM-AT.
INPUT-OUTPUT SECTION.
FILE-CONTROL.

DATA DIVISION.

FILE SECTION.
WORKING-STORAGE SECTION.

01 DATASRC PIC X(64).
01 DBUSR PIC X(64).
01 DBPWD PIC X(64).

01 DATA-01 PIC X(64).
01 DATA-02 PIC X(64).
01 DATA-03 PIC X(64).
01 DATA-04 PIC X(64).
01 DATA-05 PIC X(64).
01 DATA-06 PIC X(64).
01 DATA-07 PIC X(64).
01 DATA-08 PIC X(64).
01 DATA-09 PIC X(64).
01 DATA-10 PIC X(64).
01 DATA-11 PIC X(64).

EXEC SQL
INCLUDE SQLCA
END-EXEC.



PROCEDURE DIVISION.

000-CONNECT.
DISPLAY "DATASRC" UPON ENVIRONMENT-NAME.
ACCEPT DATASRC FROM ENVIRONMENT-VALUE.
DISPLAY "DATASRC_USR" UPON ENVIRONMENT-NAME.
ACCEPT DBUSR FROM ENVIRONMENT-VALUE.
DISPLAY "DATASRC_PWD" UPON ENVIRONMENT-NAME.
ACCEPT DBPWD FROM ENVIRONMENT-VALUE.

EXEC SQL
CONNECT TO :DATASRC USER :DBUSR USING :DBPWD
END-EXEC.

DISPLAY 'CONNECT SQLCODE: ' SQLCODE.
IF SQLCODE <> 0 THEN
GO TO 100-EXIT
END-IF.

100-MAIN.

EXEC SQL
SELECT
GENEX.CASE_BARCODE AS CASE_BARCODE,
GENEX.SAMPLE_BARCODE AS SAMPLE_BARCODE,
GENEX.ALIQUOT_BARCODE AS ALIQUOT_BARCODE,
GENEX.HGNC_GENE_SYMBOL AS HGNC_GENE_SYMBOL,
CLINICAL_INFO.VARIANT_TYPE AS VARIANT_TYPE,
GENEX.GENE_ID AS GENE_ID,
GENEX.NORMALIZED_COUNT AS NORMALIZED_COUNT,
GENEX.PROJECT_SHORT_NAME AS PROJECT_SHORT_NAME,
CLINICAL_INFO.DEMO__GENDER AS GENDER,
CLINICAL_INFO.DEMO__VITAL_STATUS AS VITAL_STATUS,
CLINICAL_INFO.DEMO__DAYS_TO_DEATH AS DAYS_TO_DEATH
INTO
:DATA-01, :DATA-02, :DATA-03, :DATA-04,
:DATA-05, :DATA-06, :DATA-07, :DATA-08,
:DATA-09, :DATA-10, :DATA-11
FROM (
SELECT
CASE_LIST.VARIANT_TYPE AS VARIANT_TYPE,
CASE_LIST.CASE_BARCODE AS CASE_BARCODE,
CLINICAL.DEMO__GENDER,
CLINICAL.DEMO__VITAL_STATUS,
CLINICAL.DEMO__DAYS_TO_DEATH
FROM
(SELECT
MUTATION.CASE_BARCODE,
MUTATION.VARIANT_TYPE
FROM
ISB-CGC-BQ.TCGA_VERSIONED.SM_HG19_DCC_02 AS MUTATION
WHERE
MUTATION.HUGO_SYMBOL = 'CDKN2A'
AND PROJECT_SHORT_NAME = 'TCGA-BLCA'
GROUP BY
MUTATION.CASE_BARCODE,
MUTATION.VARIANT_TYPE
ORDER BY
MUTATION.CASE_BARCODE
) AS CASE_LIST
INNER JOIN
ISB-CGC-BQ.TCGA.CLINICAL_GDC_CURRENT AS CLINICAL
ON
CASE_LIST.CASE_BARCODE = CLINICAL.SUBMITTER_ID )
AS CLINICAL_INFO
INNER JOIN
ISB-CGC-BQ.TCGA_VERSIONED.RNASEQ_HG19_GDC_2017_02
AS GENEX
ON
GENEX.CASE_BARCODE = CLINICAL_INFO.CASE_BARCODE
WHERE
GENEX.HGNC_GENE_SYMBOL IN
('MDM2', 'TP53', 'CDKN1A','CCNE1')
ORDER BY
CASE_BARCODE,
HGNC_GENE_SYMBOL
END-EXEC.

EXEC SQL CONNECT RESET END-EXEC.

100-EXIT.
STOP RUN.

200-END.
Loading

0 comments on commit a6fc97c

Please sign in to comment.