-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- 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
Showing
39 changed files
with
2,724 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
Oops, something went wrong.