Select code within AS/400 query

265 pts.
Tags:
AS/400
AS/400 Query
I have to run a Query based on PF without DDS with record length 2997. I have to select Company Code '01' which is the 925-927 positions in the file. How do I do select in the Query? Please advice. Thank you.

Software/Hardware used:
AS/400

Answer Wiki

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

I’m not sure if query will work with a file that long
However, you would make a result field using substr to get the company
Then use the result field in the select record option.

But you say Company Code ’01′ which is the 925-927 — 925-927 is three characters wide?

Phil

Discuss This Question: 5  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
  • Larisagas
    Thank you. The Company Code is '001'. But who to create substring if there no fields names?
    265 pointsBadges:
    report
  • DanTheDane
    Non-DDS files actually has a filename for the whole record. Find your file's fieldname using this command, which uses query/400:
    runqry *n mylib/myfile
    
    The fieldname to use in your query will be the heading-name (propably F00001..). Now create your query making a resultfield : enter a resultfieldname, fx COMPCOD, and enter this expression
    substr(F00001, 925, 3)
    
    Then enter some selection in your query, and VOILA.... :-) I hope thisworks for you DanF
    2,555 pointsBadges:
    report
  • Larisagas
    Thank you Dan, it worked and It is so simple...
    265 pointsBadges:
    report
  • RossHowatson
    Look to see if the file contains a System 36 IDDU (Interactive Data Definition Utility) layout. If so then link the file using this utility and suddently you have a file layout. If you do not have a layout then make one using this utility and link the file and now you have the file layout that can be used for more than one field of information. As well IDDU allows you to have multiple layouts for a file.
    265 pointsBadges:
    report
  • TomLiotta
    ...System 36 IDDU (Interactive Data Definition Utility)... For those unfamiliar, the STRIDD command can give you initial access to IDDU. There are some interesting effects that are possible, though expertise is dwindling. 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