How to extract a range of variable from a list in PF where the variable is in the middle of a string. Ex: A12LO to A25LO.

10 pts.
Tags:
AS/400 objects
AS/400 Query
AS/400 Query Select Records
Hi All, Please help me. I have a physical file with a list of objects that are in a library. The object names ranges from A80395LO to A80635LO and B80395LO to B80635LO and so on... I want to filter out only the object names with range from 80400 to 80410. Is it possible using query? Please let me know if there any other way to do it. Thanks in advance!

Answer Wiki

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

Discuss This Question: 3  Replies

 
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
  • philpl1jb
    Using Query/400 value always starts at position 2 and is 5 long? Then I would start with the Define result fields option Define a new field which is a substr(filename ,2,5) Then in your select records you can use that field with a RANGE
    49,850 pointsBadges:
    report
  • CharlieBrowne
    You can use SQL STRSQL Select * from yourlib/yourfile where substr(yourfield, 2,5) >= '80400' and substr(yourfield, 2,5) <= '80410'
    41,380 pointsBadges:
    report
  • TomLiotta
    Which query function is being used? There are a number of them that might be used. . If this a one-time need, I would create a SQL VIEW and use it. Once the VIEW exists, you can run straight queries over it with any query tool. But I'm comfortable with using VIEWs. . It might also depend on what the result set of rows will be used for. If it's going to be used to copy into a second file, it might be different from simply using the rows immediately for a printed report or listing on a screen, and never needing those rows again. . Tom
    125,585 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