I get an error trying to compile this code. The problem is with DAYNUM , but I don't see what's wrong. It is defined a 3,0 in an earlier step.
Field YEARY is an alpha string, and I want to pull out a value at position = DAYNUM
Not allowed to use a variable in SUBSTR ? O/S = V7 R4
The compile error says "... SQL0171 Position 17 Argument 2 of function SUBSTRING not valid. ..."
C/EXEC SQL
C+ SET :SHIPDAY = (SELECT SUBSTR(YEARY, :DAYNUM,1)
C+ FROM SHPDAY00
C+ where YRKYR = :YEAR
C+ and YWHSE = :OHWHSE )
C+
C/END-EXEC
Field YEARY is an alpha string, and I want to pull out a value at position = DAYNUM
Not allowed to use a variable in SUBSTR ? O/S = V7 R4
The compile error says "... SQL0171 Position 17 Argument 2 of function SUBSTRING not valid. ..."
C/EXEC SQL
C+ SET :SHIPDAY = (SELECT SUBSTR(YEARY, :DAYNUM,1)
C+ FROM SHPDAY00
C+ where YRKYR = :YEAR
C+ and YWHSE = :OHWHSE )
C+
C/END-EXEC