Hi All , having a torrid time trying to get something I thought simple to work !
I have the following code in a CL to pass a date to a Query and I get an error saying the date in not valid as it's not character - please help me !
1900 - CVTDAT DATE('190413') TOVAR(&JULDAT) FROMFMT(*DMY) TOFMT(*JUL)
TOSEP(*NONE)
3000 - CVTDAT DATE('11109') TOVAR(&CYMD) FROMFMT(*JUL) TOFMT(*CYMD)
TOSEP(*NONE)
3201 - STRQMQRY QMQRY(AMPHQRY/IMHISTARCH) OUTPUT(*OUTFILE)
QMFORM(*QMQRY) OUTFILE(SPLIB/IMHISTARCH) OUTMBR(*FIRST *ADD)
ALWQRYDFN(*YES) SETVAR((CYMD) ('1110419'))
1110419 is not a valid Query Management variable.
Error found on STRQMQRY command.
The error details are :-
Message ID . . . . . . : QWM1937 Severity . . . . . . . : 40
Message type . . . . . : Diagnostic
Date sent . . . . . . : 19/04/13 Time sent . . . . . . : 12:38:09
Message . . . . : 1110419 is not a valid Query Management variable.
Cause . . . . . : The 1110419 variable entered on the SETVAR parameter
contains a value which is not valid. The return code is 1.
The following return codes are possible:
1 - The first character is not alphabetic.
2 - One of the remaining characters is not alphanumeric or an '_'.
3 - The variable begins with 'DSQ'. A variable that begins with 'DSQ'
cannot be used from the SETVAR parameter.
How do I code this to get the parameter passed ?
Many thanks,
Simon
I have the following code in a CL to pass a date to a Query and I get an error saying the date in not valid as it's not character - please help me !
1900 - CVTDAT DATE('190413') TOVAR(&JULDAT) FROMFMT(*DMY) TOFMT(*JUL)
TOSEP(*NONE)
3000 - CVTDAT DATE('11109') TOVAR(&CYMD) FROMFMT(*JUL) TOFMT(*CYMD)
TOSEP(*NONE)
3201 - STRQMQRY QMQRY(AMPHQRY/IMHISTARCH) OUTPUT(*OUTFILE)
QMFORM(*QMQRY) OUTFILE(SPLIB/IMHISTARCH) OUTMBR(*FIRST *ADD)
ALWQRYDFN(*YES) SETVAR((CYMD) ('1110419'))
1110419 is not a valid Query Management variable.
Error found on STRQMQRY command.
The error details are :-
Message ID . . . . . . : QWM1937 Severity . . . . . . . : 40
Message type . . . . . : Diagnostic
Date sent . . . . . . : 19/04/13 Time sent . . . . . . : 12:38:09
Message . . . . : 1110419 is not a valid Query Management variable.
Cause . . . . . : The 1110419 variable entered on the SETVAR parameter
contains a value which is not valid. The return code is 1.
The following return codes are possible:
1 - The first character is not alphabetic.
2 - One of the remaining characters is not alphanumeric or an '_'.
3 - The variable begins with 'DSQ'. A variable that begins with 'DSQ'
cannot be used from the SETVAR parameter.
How do I code this to get the parameter passed ?
Many thanks,
Simon
Comment