CHGVAR VAR(QRYSLT) VALUE('DATE *EQ %RANGE(&PDATE &EDATE)
OPNQRY FILE(FILE) QRYSLT(&QYRSLT) ....
--
Gernot Langle
PARAS Solutions, Inc.
http://www.parassolutions.com
mailto:gla...@parassolutions.com
Hope this helps,
Judi
&FLT *CHAR *LEN(2)
INPUT FROM DISPLAY &FLT MAY BE "ME', "LH", etc.
NEED QRYSLT TO SUBSTR LAST TWO CHARACTERS IN 6 CHAR FIELD FROM DATABASE AND
SELECT IF EQ &FLT
DCL &PDATEC *CHAR 7
DCL &EDATEC *CHAR 7
CHGVAR &PDATEC &PDATE
CHGVAR &PDATEC &PDATE
> CHGVAR VAR(QRYSLT) VALUE('DATE *EQ %RANGE(&PDATE &EDATE)
Use this:
CHGVAR &QRYSLT ('DATE *EQ %RANGE(' *CAT &PDATEC *BCAT &EDATEC *CAT ')')
> OPNQRY FILE(FILE) QRYSLT(&QYRSLT) ....
Hope it helps
Bye, Christian
hth,
Judi
Daniel W. Exum wrote in message ...
Need for given sample data "ME": qryslt('%sst(Char6Field 5 2) *eq "ME"')
Use: CHGVAR &SLT VALUE('%sst(Char6Field 5 2) *EQ "' *cat &FLT *cat '")')
Note: the %sst() is the query function, not the CL function
Regards, Chuck
All comments provided "as is" with no warranties of any kind whatsoever.
This would work okay under two conditions. First, you'd need to specify
that <%> was being used as the substring wildcard character -- an
asterisk <*> is the default. Second, it would match any time the last
two non-blank characters were <ME> if &FLT='ME'.
However, if you wanted to match _only_ against positions 5 and 6 of a
*CHAR 6 field, you should use:
VALUE('FIELD *EQ %WLDCRD(''____' *cat &FLT *cat ''')')
Use four underscores to make the first four positions match any
characters.
Tom Liotta
In article <WpHu3.344$jp4....@news.uswest.net>,
"Judi Martin" <bri...@juno.com> wrote:
> You could try this:
> CHGVAR VAR(QRYSLT) VALUE('FIELD *EQ %WLDCRD("%' *cat &FLT *cat'")')
> It should come out as FIELD *EQ %WLDCRD("%ME")
>
> hth,
> Judi
>
> Daniel W. Exum wrote in message ...
> > Worked great thanks for help. Now could you help me select only
records
> >that the last two characters are "&FLT" in 6 character field.
> >
> >&FLT *CHAR *LEN(2)
> >
> >INPUT FROM DISPLAY &FLT MAY BE "ME', "LH", etc.
> >NEED QRYSLT TO SUBSTR LAST TWO CHARACTERS IN 6 CHAR FIELD FROM
DATABASE AND
> >SELECT IF EQ &FLT
> >
> >
>
>
--
Tom Liotta
AS/400 systems programmer
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
I believe the second is a concern only for a variable-length column,
but for a fixed-length column, blanks are significant. As such
the selection 'FIELD *EQ %WLDCRD("*ME")' on a fixed-length column
would match only when the last two characters were 'ME'; not the
last two non-blanks.
In either case the comparison value '*ME' is different than '*ME ';
the latter requires the blank for a selection <not probable with a
varying-length string>, the former requires there is no blank.
Regardless, to be clear on intentions with such a selection coded
in a program, I would choose to compare only the two bytes of interest
by use of %sst.
VALUE('FIELD *EQ %WLDCRD("*' *cat &FLT *cat '")') matches any fixed or
variable length field ending in ME (as example).
VALUE('FIELD *EQ %WLDCRD(''____' *cat &FLT *cat ''')') matches any fixed
length 6 character field ending in ME.
VALUE('%sst(Char6Field 5 2) *EQ "' *cat &FLT *cat '")') matches any fixed or
variable length field containing ME at positions 5 and 6.
I will agree the last is most clear, altho in this instance any of the three
should work.
Judi
I'd sure like to meet you someday. You ever get to COMMON or elsewhere?
If you get close to retiring or getting out of the AS/400 business,
would you send an early warning to us? You'll be missed.
Tom Liotta
In article <37BBF8B...@vnet.ibm.com>,
"Charles R. Pence" <crp...@vnet.ibm.com> wrote:
> Thomas wrote:
> >> "Judi Martin" <bri...@juno.com> wrote:
> >> You could try this:
> >> CHGVAR VAR(QRYSLT) VALUE('FIELD *EQ %WLDCRD("%' *cat &FLT
*cat'")')
> >> It should come out as FIELD *EQ %WLDCRD("%ME")
> > This would work okay under two conditions. First, you'd need to
specify
> > that <%> was being used as the substring wildcard character -- an
> > asterisk <*> is the default. Second, it would match any time the
last
> > two non-blank characters were <ME> if &FLT='ME'.
> >
> > However, if you wanted to match _only_ against positions 5 and 6 of
a
> > *CHAR 6 field, you should use:
> >
> > VALUE('FIELD *EQ %WLDCRD(''____' *cat &FLT *cat ''')')
> >
> > Use four underscores to make the first four positions match any
> > characters.
>
> I believe the second is a concern only for a variable-length column,
> but for a fixed-length column, blanks are significant. As such
> the selection 'FIELD *EQ %WLDCRD("*ME")' on a fixed-length column
> would match only when the last two characters were 'ME'; not the
> last two non-blanks.
>
> In either case the comparison value '*ME' is different than '*ME ';
> the latter requires the blank for a selection <not probable with a
> varying-length string>, the former requires there is no blank.
>
> Regardless, to be clear on intentions with such a selection coded
> in a program, I would choose to compare only the two bytes of interest
> by use of %sst.
>
> Regards, Chuck
> All comments provided "as is" with no warranties of any kind
whatsoever.
>
--