I continue to receive an error (SQLCODE -199) on a statement that works in other sql programs. I have looked and looked at it, it looks fine to me. Can someone please look at the following code and tell me if you see any reason for the error? Object XSROLOTV1 in library GPSMODS not found. The error I receive is below.
Any help is appreciated. Thank you.
ERROR -
Object XSROLOTV1 in GPSMODS type *FILE not found.
Object XSROLOTV1 in QTEMP type *QMQRY deleted.
IMPORT source record length exceeds 79 characters.
Warnings issued on IMPORT QUERY command.
IMPORT operation completed successfully.
Warning returned by query management.
Keyword FROM not expected. Valid tokens: ) ,.
RUN QUERY command failed with SQLCODE -199.
RUN QUERY command ended due to error.
STRQMQRY command failed.
Function check. QWM2701 unmonitored by RUNGPSSQL at statement 13200,
SQL -
(INT(YEAR(DATE((DAYS(DATE(SUBSTR(CHAR(INT(LTDDAT/10000)) FROM 1 TO 4) || '-' || SUBSTR(CHAR(DEC((INT(LTDDAT/100) - INT(LTDDAT/10000)*100))/100) FROM 2 FOR 2) || '-' || SUBSTR(CHAR(DEC(LTDDAT - INT(LTDDAT/100)*100)/100) FROM 2 FOR 2) ))) - (DAYOFWEEK(DATE(SUBSTR(CHAR(INT(LTDDAT/10000)) FROM 1 FOR 4) || '-' || SUBSTR(CHAR(DEC((INT(LTDDAT/100) - INT(LTDDAT/10000)*100))/100)) FROM 2 FOR 2) || '-' || SUBSTR(CHAR(DEC(LTDDAT - INT(LTDDAT/100)*100)/100) FROM 2 FOR 2)))) + 1))) *100)
+
INT(WEEK(DATE((DAYS(DATE(SUBSTR(CHAR(INT(LTDDAT/10000)) FROM 1 FOR 4) || '-' || SUBSTR(CHAR(DEC((INT(LTDDAT/100) -INT(LTDDAT/10000)*100))/100) FROM 2 FOR 2 || '-' || SUBSTR(CHAR(DEC(LTDDAT - UBT(LTDDAT/100)*100)/100) FROM 2 FOR 2)))) (DAYOFWEEK(DATE(SUBSTR(CHAR(INT(LTDDAT/10000)) FROM 1 FOR 4) || '-' || SUBSTR(CHAR(DEC((INT(LTDDAT/100) - INT(LTDDAT/10000)*100))/100) FROM 2 FOR 2 || '-' || SUBSTR(CHAR(DEC(LTDDAT -INT(LTDDAT/100)*100)/100) FROM 2 FOR 2)))) + 1))) AS LTDDATYWYou can't pass the keyword FROM as a column alias within a SUBSTR function.
... SUBSTR(CHAR(DEC(LTDDAT-INT(LTDDAT/100)*100)/100) FROM 2 FOR 2)
Isn't the syntax supposed to be SUBSTR(string, start, length). The parenthesis after 2 FOR 2 ends the SUBSTR function.
Find the integer value, multiply by 100, subtract fro LTDDAT, convert to decimal, divide by 100, convert to character, then find a Substring within that resulting character string.
Maybe you only need to replace FROM with a comma, and replace FOR with a comma. the rest looks good.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment