Can we restrict the fields in OPNQRYF?

2,410 pts.
Tags:
AS/400
OPNQRYF
STRSQL
Like we select fields in STRSQL, is there a way I can specify the fields I want in OPNQRYF? Say I have 40 fields in my file, but I am interested in 10 fields and wanted to make a CSV out of it. Can I achieve this with OPNQRYF instead of creating another file with the 10 fields?

Software/Hardware used:
AS400
ASKED: February 11, 2013  9:19 AM
UPDATED: February 11, 2013  1:14 PM

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: 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
  • TomLiotta
    Creating another file is more efficient and easier, usually because all you need to create is a VIEW; but yes, you can do it with OPNQRYF. All you need is a record format that you can reference that lists the fields you need. You usually make such a format available to OPNQRYF by creating a file description with the fields you need, then specify the record format in the FORMAT() parameter. It's hard to think of a good reason to use OPNQRYF, though. It's rarely the best choice for anything. -- 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