• Reading records from a file (No Key Field) in reverse order through CL.

    Hi, I just want to know how to read a PF in reverse order through CL. File has no key field. I am trying this using OPNQRYF but I'm unable to get. Kindly let me know the code. Thanks

    HABBIE210 pointsBadges:
  • CPF5149 error message when file is opened in update mode

    In my CL program I have an OPNQRYF on a file with option as (*UPD) OvrDbf File(FDFILE) Share(*Yes) OpnQryF File(FDFILE) Option(*Upd) + QrySlt('STATUS *NE "A" *And + FREQ *GT "0" *And (FDSDTP *LT "' *Cat &CurDat *Cat '") *And (MATURITY *GT "' *Cat &CurDat *Cat '") ') After this I am calling...

    RamvishakRamesh2,410 pointsBadges:
  • OVRDBF and OPNQRYF

    Can we write OPNQRYF then OVRDBF with SHARE(*YES) and then call a program. Will this program will process only selected records from OPNQRYF or process all records?

    sunnygupta35 pointsBadges:
  • SQL and OPNQRYF

    What we can do in SQL which we cannot do in OPNQRYF

    sunnygupta35 pointsBadges:
  • Can you update physical file through OPNQRYF?

    Can we update physical file through OPNQRYF command in clle (AS400)?Is it possible? OPNQRYF FILE((lib/pf)) OPTION(*UPD) QRYSLT('CDE + *EQ 101 ') KEYFLD((CDE))

    shyedajmal285 pointsBadges:
  • Difference between two OVRDBF approaches

    What is the difference between the below two approaches? OVRDBF FILE(FILE1) SHARE(*YES) SEQONLY(*YES) OPNQRYF (SOME CONDITION) CALL PGM1 DLTOVR FILE(FILE1) CLOF OPNID(FILE1) OVRDBF FILE(FILE1) SHARE(*YES) SEQONLY(*YES) OPNQRYF (SOME CONDITION) CALL PGM1 CLOF OPNID(FILE1) DLTOVR FILE(FILE1)

    rajeshece1,215 pointsBadges:
  • Access a OPNQRYF file using keys

    Is it possible to access a file created by opnqryf in an RPG/400 program using keys? I have defined the KEYFLD parameter but the RPG doesn't find the records when using READE or CHAIN.

    Marg5 pointsBadges:
  • OPNQRYF problem CPF9899

    DCLF FILE(LIBRARY/DISPLAY) START: SNDRCVF RCDFMT(REC) WAIT(*YES) IF COND(&IN03 *EQ '1') THEN(DO) GOTO CMDLBL(END) ENDDO IF COND(&ENQQUA1 *EQ ' ') THEN(DO) GOTO CMDLBL(START) ENDDO IF COND(&ENQQUA1 *NE *BLANKS) THEN(DO) OPNQRYF FILE((SARKNS/ENQP002)) OPTION(*ALL) + QRYSLT('&ENQQUA...

    Khadar90 pointsBadges:
  • OPNQRYF query not working to filter pfdiv records

    I have 4-fileds on Display File like frdiv(zoned),todiv(zoned),frpr(char),topr(char). All the fields are of size 2 only. I am using a "OPNQRYF" to filter the records from a Physical file (pfdiv), it contains 1,25,000 records . Through this openqryf all the selected records I will copy to a file...

    Khadar90 pointsBadges:
  • OPNQRYF error in QRYSLT

    PGM DCLF FILE(LIBRARY/DISPLAY) START: SNDRCVF RCDFMT(REC) WAIT(*YES) IF COND(&IN03 *EQ '1') THEN(DO) GOTO CMDLBL(END) ENDDO IF COND(&ENQQUA1 *EQ ' ') THEN(DO) GOTO CMDLBL(START) ENDDO IF COND(&ENQQUA1 *NE *BLANKS) THEN(DO) OPNQRYF FILE((SARKNS/ENQP002)) OPTION(*ALL) +...

    Khadar90 pointsBadges:
  • Temporary logical files with OVRDBF and OPNQRYF

    Hi All, I have a series of questions I would like to discuss few of them here. I'll post them in a different threads so that it will be easier to track them: AS 400 question 1: When you say that an OVRDBF and an OPNQRY creates a temporary logical file, - Say I am just using OVRDBF and not OPNQRY....

    juslikdat1440 pointsBadges:
  • Improving performance using OPNQRYF

    I have a requirement that, in a country related code file. (CntryCode, Name, AccessNo) if these are three fields... and I would like to pass the respective country code and get only the required country values. But this is also taking time when using OPNQRYF with QRYSLT country code. Is there any...

    Varun123190 pointsBadges:
  • Problem with the syntax of OPNQRY command

    Hi I have a problem with the syntax of OPNQRY command I am getting values from a display file using RCVF and then using the qryslt parameter in OPNQRY to select a few records;See the command below OPNQRYF FILE((*LIBL/APH *FIRST *ONLY)) + QRYSLT('APCMPY *EQ ''*CAT XPCMP *CAT''') Where XPCMP(numeric)...

    itanswers0 pointsBadges:
  • Join files using OPNQRYF

    I'm not much familiar with complex OPNQRYF statements. I need to select records from a file say FileA which has a field AccNo. I need to select those accounts whose country code ='002'. Country code comes from another file say FileB. FileB has account number as key. I know this is simple, but I am...

    RamvishakRamesh2,410 pointsBadges:
  • Two OPNQRYF on same file

    I have a file which has account opened date and account changed date. In my RPG program, I need to extract all those accounts opened today. and do some calculations. Then I need to extract all those accounts that are changed today and status is not 'Cancelled' My file doesn't have either opened...

    RamvishakRamesh2,410 pointsBadges:
  • Can we restrict the fields in OPNQRYF?

    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?

    RamvishakRamesh2,410 pointsBadges:
  • OVRDBF & OPNQRY – AS/400 question

    AS/400 question: There is a scenario where: OVRDBF share (*yes) OPNQRY – To select only Active records CALL RPG1 But in my RPG all records are being processed. Just not active. What could be the reason behind it? And also, OVRDBF share (*no) OPNQRY – To select only Active records CALL RPG1 But...

    juslikdat1440 pointsBadges:
  • OVRDBF & OPNQRY – AS/400 question

    AS/400 question: Say, there are 3 programs. RPG 1, RPG2 & RPG 3. I have OVRDBF and OPNQRY which selects only active customer records. I want RPG 1 to use the OPNQRYF output data. I want RPG 2 to use the complete data I want RPG 3 to use the OPNQRYF output data again. This is how it was...

    juslikdat1440 pointsBadges:
  • OPNQRYF – COUNT

    Hi How can we use count of file in OPNQRYF CL command?

    iiiiiiiiiiiii335 pointsBadges:
  • OPNQRYF & CPYFRMQRYF error

    The log is: output file file1 created file1 added to library mmember of file1 is opened in library. data option was not allowed with open option error reading member file1 in file1 0 records copied to file2

    Archnav01270 pointsBadges:

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