Outfile printing

270 pts.
Tags:
CL
cpyqryf
OPNQRYF
RPG
RPGLE
In CL, I've created a outfile out of dspobjd cmd. To this file, i've filtered a column using opnqryf. I've copied the output (cpyqryf) to a new file. While doing this, i'm getting the error data option was not allowed with open option' The log shows :The first file is created-> added to library. Seqonly (*no) Error occurs when copying data.
ASKED: October 16, 2012  7:14 AM

Answer Wiki

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

The log is:

output file file1 created

file1 added to library

mmember of file1 is opened in library.

data option was not allowed with opn option

error reading member file1 in file1

0 records copied to file2.

Discuss This Question: 7  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
  • Archnav01
    The log is: output file file1 created file1 added to library mmember of file1 is opened in library. data option was not allowed with opn option error reading member file1 in file1 0 records copied to file2
    270 pointsBadges:
    report
  • Archnav01
    Now i tried to close the file file1 before the opnqryf cmd.. The error i'm getting is : Open-identifier specified for FROMOPNID not valid.
    270 pointsBadges:
    report
  • TomLiotta
    Not enough information. Any time errors are to be reported, the message identifier is needed. Usually, an error that makes a difference will be an *ESCAPE message. An escape message might be preceded by one or two *DIAG (diagnostic) messages. With the message IDs, simple text is often useless. -- Tom
    125,585 pointsBadges:
    report
  • TomLiotta
    Beyond error reporting, the use of OPNQRYF should be avoided. The command comes from the original System/38 back in the 1970s, before SQL existed. If you're simply 'filtering a column', a basic CREATE VIEW or a straight SQL SELECT is probably a much better choice. The modern needs for OPNQRYF are extremely limited. -- Tom
    125,585 pointsBadges:
    report
  • Archnav01
    Is the data flow correct:dspobjd->outputfile(file1)->opnqryf (for where condition)-> cpyfrmqryf (to a new file, file2). It is getting compiled. While execution it says, Upon the 1st run, ‘data option was not allowed with open option’. further runs, ‘file1 is already in use’. Can u help?
    270 pointsBadges:
    report
  • TomLiotta
    Is the data flow correct:   We can't know. We don't know what you're trying to do. If it gives results you need, it's correct enough. If not, it isn't. So far, you're asking only about purely technical issues. A technical item essentially works or doesn't work.   But you haven't given any business reason. We don't know why you're doing this nor what result you're seeking. We can't know if what you're doing is appropriate or not.   ...opnqryf (for where condition)...   Using a WHERE condition would be much easier.   ...cpyfrmqryf (to a new file, file2)   It seems that you don't actually need a new file, so there's no way to know if that step makes sense.   ‘file1 is already in use’. Can u help?   Most likely, you didn't close the files when the first error occurred. Until you do the close (or closes) or possibly until you run the process in a different job, it will give that error every time.   But it might be something else. It's not clear without a message ID.   Tom
    125,585 pointsBadges:
    report
  • Archnav01
    I want to run a batch job which upon executig wuld fetch the objects present in all the user libraries (for excluding source phy file item i'm using qryslt, which should omit the 'q..' starting with 'q'). The final list still contains the objects starting with alphabet 'q'., seems the qryslt is not working.
    270 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