Facing Issue while Using Import in BTeq

Tools & Utilities
Enthusiast

Facing Issue while Using Import in BTeq


SET WIDTH 80;
SET PAGELENGTH 1;
SET ECHOREQ OFF;
SET HEADING '';
SET SEPARATOR '';
SET SIDETITLES ON;
SET FORMAT OFF;
SET TITLEDASHES OFF;
IMPORT DDNAME=IN1;
REPEAT *
USING
PDT (CHAR(19))

IMPORT DDNAME=IN2;
REPEAT 1
USING
CMP (CHAR(03))

SELECT *
FROM table1
WHERE FIN_TRANS_PST_TSTP > :PDT AND
SRC_CO = :CMP;

IF ACTIVITYCOUNT > 0 THEN .QUIT 2;
LOGOFF;
QUIT;

This is the code tat i use to import data for the two fields PDT and CMP and i want to use it to compare it with the fields taken from the table. i have made sure that the format of the data remains the same (both from the table and from the file). But i get the following errors

Failure 3706 Syntax error: expected something between ')' and '.'.
Statement# 2, Info =53
Input row number = 1 *** Total elapsed time was 0.00 seconds.
-----+---------+---------+---------+---------+---------+---------+--
-----+---------+---------+---------+---------+---------+---------+--
Starting Row 1 at 05:09:03 on Tue Dec 16, 2008
Failure 3857 Cannot use value (or macro parameter) to match 'PDT'.
Statement# 1, Info =0
Input row number = 2 *** Total elapsed time was 0.01 seconds.
Warning: Repeat is cancelled.


Please help me in this. Also i m trying to get a return code of 2 if the query returns an answer row, so that i can use tat code in the next step for aborting the job.
1 REPLY
Junior Contributor

Re: Facing Issue while Using Import in BTeq

Hi Ajai,
you can't do nested IMPORTs in BTEQ.

You might create a file for a RUN by EXPORTing a string concatenating the SQL and parameters.
Or concatenate both inputs into a single file prior to executing BTEQ or within BTEQ using a .SYSTEM command. But i don't know how to do this on a mainframe.

Dieter