I am trying to pull a comma delimited input file into my JCL, so that I can update a Teradata table.
I have run the query through Queryman and know that the SQL works fine, when the data is typed in. My problem is that I have to pull the data in using a SYSIN statement, then put it in a string. To do this, I am surrounding the data in single quotes, this is where the problem comes in (I believe). Here's a portion of my code:
I've also tried it using Control Cards as below:
What it ends up looking like is:
No matter which way I do it, the data doesn't get pulled in, the actual DD statement does. I've read the Teradata Bassic SQL reference document and it looks like the problem is that I am ending the line before the dataset name with a single quote. So, it's looking for the closing quote before it does anything.
Is there a way for me to tell Teradata to stop reading the statements as data, but not end the SQL? I've tried the /* as above, and also the ##. But neither work the way I need it to.
Does anyone have an idea on how to fix, or perhaps a better way to do this?
Thanks!
I have run the query through Queryman and know that the SQL works fine, when the data is typed in. My problem is that I have to pull the data in using a SYSIN statement, then put it in a string. To do this, I am surrounding the data in single quotes, this is where the problem comes in (I believe). Here's a portion of my code:
Code:
//SYSIN DD DATA,DLM=##
.LOGON TDP/UserID,Password;
UPDATE MyDB.MyTable
FROM(
SELECT '
/*
//SYSIN DD DSN=MY.DATASET.NAME,DISP=SHR
//SYSIN DD DATA,DLM=##
' INPUT_DATA
,POSITION(',' IN INPUT_DATA) FIRST_COMMA
I've also tried it using Control Cards as below:
Code:
//SYSIN DD DSN=DC4785.CNTL(DWLOGDEV),DISP=SHR
// DD DSN=DC4785.CNTL(CC1),DISP=SHR
// DD DSN=CABSC.BARS.CF15R.OUTPUT(0),DISP=SHR
// DD DSN=DC4785.CNTL(CC2),DISP=SHR
// DD DSN=CORPC.CNTLCARD(BTEQQUIT),DISP=SHR
What it ends up looking like is:
Code:
FROM(
SELECT '//SYSIN DD DATA,DLM=##//SYSIN DD DSN=
Is there a way for me to tell Teradata to stop reading the statements as data, but not end the SQL? I've tried the /* as above, and also the ##. But neither work the way I need it to.
Does anyone have an idea on how to fix, or perhaps a better way to do this?
Thanks!