Good morning, building sql in my program to collect data for a subfile.
It is in a procedure, I get a compile error on the 'not in ( )' statement. here is main code:
----------------------------------------------------------------------------------------------
Exec SQL
create table qtemp/ScrDetails (
PORT dec (5,0) NOT NULL WITH DEFAULT,
PAYTYP CHAR ( 1) ccsid 37 NOT NULL WITH DEFAULT,
COMPCD CHAR ( 3) ccsid 37 NOT NULL WITH DEFAULT,
DIVSN CHAR ( 1) ccsid 37 NOT NULL WITH DEFAULT,
JOBDS CHAR ( 4) ccsid 37 NOT NULL WITH DEFAULT,
FIRST CHAR (10) ccsid 37 NOT NULL WITH DEFAULT,
LAST CHAR (15) ccsid 37 NOT NULL WITH DEFAULT,
WSTAT CHAR ( 1) ccsid 37 NOT NULL WITH DEFAULT,
ESTAT CHAR ( 1) ccsid 37 NOT NULL WITH DEFAULT);
// Read through USRDEPT file to get all the COMP/DIV/DEPT combinations
// this user oversees
Setll (Ldausrid)USRDEPT;
Dou %EOF(USRDEPT);
Reade (Ldausrid)USRDEPT;
If %Found(USRDEPT) and DSTSCD <> 'D';
Exec Sql
insert into qtemp/ScrDetails
select MPORT,MPAYTP,MCOCDE,MDIVSN,MJOBDS,FNAME,MNAME,
WRKSTS from PRLIBRF/PRMSTR where MCOCDE =
COMCD and
MDIVSN =
DIVSN and MJOBDS =
DEPT and MSTAT not
in('T','L','Y','Z','D','X') order by MCOCDE,MDIVSN,MJOBDS;
Enddo;
-------------------------------------------------------------------------------------------------
Compile error is: SQL1103 10 532 Position 27 Column definitions for table SCRDETAILS in
QTEMP not found.
I do have a file created in QTEMP and in the main library of the program at compile time.
Any help would be appreciated. Thank you.
It is in a procedure, I get a compile error on the 'not in ( )' statement. here is main code:
----------------------------------------------------------------------------------------------
Exec SQL
create table qtemp/ScrDetails (
PORT dec (5,0) NOT NULL WITH DEFAULT,
PAYTYP CHAR ( 1) ccsid 37 NOT NULL WITH DEFAULT,
COMPCD CHAR ( 3) ccsid 37 NOT NULL WITH DEFAULT,
DIVSN CHAR ( 1) ccsid 37 NOT NULL WITH DEFAULT,
JOBDS CHAR ( 4) ccsid 37 NOT NULL WITH DEFAULT,
FIRST CHAR (10) ccsid 37 NOT NULL WITH DEFAULT,
LAST CHAR (15) ccsid 37 NOT NULL WITH DEFAULT,
WSTAT CHAR ( 1) ccsid 37 NOT NULL WITH DEFAULT,
ESTAT CHAR ( 1) ccsid 37 NOT NULL WITH DEFAULT);
// Read through USRDEPT file to get all the COMP/DIV/DEPT combinations
// this user oversees
Setll (Ldausrid)USRDEPT;
Dou %EOF(USRDEPT);
Reade (Ldausrid)USRDEPT;
If %Found(USRDEPT) and DSTSCD <> 'D';
Exec Sql
insert into qtemp/ScrDetails
select MPORT,MPAYTP,MCOCDE,MDIVSN,MJOBDS,FNAME,MNAME,
WRKSTS from PRLIBRF/PRMSTR where MCOCDE =
COMCD andMDIVSN =
DIVSN and MJOBDS =
DEPT and MSTAT notin('T','L','Y','Z','D','X') order by MCOCDE,MDIVSN,MJOBDS;
Enddo;
-------------------------------------------------------------------------------------------------
Compile error is: SQL1103 10 532 Position 27 Column definitions for table SCRDETAILS in
QTEMP not found.
I do have a file created in QTEMP and in the main library of the program at compile time.
Any help would be appreciated. Thank you.




Comment