Use Wild Card in Query/AS400

20 pts.
Tags:
AS/400
AS/400 Query
How do you use wild card for the field in flat file in query AS/400. for example I want to display field acct# in position 150 and grade# in position 220 of CustInfor (flatfile)

Answer Wiki

Thanks. We'll let you know when a new response is added.

you need to create a result field for the data at the position in the flat file that you want to interrogate.  IN wrk wry ‘define result field’ try

MYBIT       substr(datafield,150,8)   
then select records if 
MYBIT  EQ  ’12345′  

or whatever your particular situation requires.



Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • ToddN2000
    Define 2 work fields.
    WORK1       substr(custinfor,150,len)
    WORK2       substr(custinfor,220,len)

    then on select records
           WORK1             LIKE   '%mychk%'  
    OR     WORK2             LIKE   '%mychk2%' 

    For a true wild card use an underscore to replace all wildcard positions like this.
    .FIRSTNAME LIKE 'J__n'   will return (John, Jean, Joan, ...)
    9,690 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following