DSPFD command throws CPF3601

Profile: mohit123
Tags:
*MBRLIST
AS/400
CL
DSPFD
Outfile
I have written a code to delete members from a physical file if the maximum member size reached in physical file. I am using DSPFD command to create a outfile and delete members which are older then a given date. My CL looks like
-> dclf file(qtemp/ehutmp) opnid efile then create outfile -> dspfd file(ehub) type(*mbrlist) output(*outfile) outfile(qtemp/ehutmp) and then reading file -> rcvf rcdfmt(qwhfdml) opnid(efile). I have compiled the source. It runs fine on my machine. But it different machine throws CPF3061 message, record format QWHFDML not found for file ehub. Please help regarding this. Thanks in advance

10 Replies to this discussion

 
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 other members reply.
  • ToddN2000
    By creating the file in QTEMP, it will only run on the machine that created the file. QTEMP it part of the users work space for that device only.

    136,470 pointsBadges:
    report
  • mohit123
    thanks for the response Todd.

    Let me explain the code ->

    we add members to ehub or ehup file depending on the &type parameter passed to CL program.Also we have to remove older members if member size is reached
    in PF.

    PGM(&type,&name,&text)
    DCLF (qtemp/ehubtmp) opnid efile
    DCLF (qtemp/ehuptmp) opnid pfile

    if &type = e (remove members from ehub pf)
    addpfm(&name) file(ehub)
    Monmsg (for member size reached) exec Do
    DSPFD(EHUB) type(*mbrlist) output(*outfile) outfile(qtemp/ehubtmp)
    rcvf QWHFDML opnid efile
    delete older members and add member &name.

    if &type = p (remove member from ehup pf)
    addpfm(&name) file(ehup)
    Monmsg (for member size reached) exec Do
    DSPFD(EHUP) type(*mbrlist) output(*outfile) outfile(qtemp/ehuptmp)
    rcvf QWHFDML opnid pfile
    delete older members and add member &name.

    I created the ehubtmp and ehuptm by running DSPFD command mention in above CL, to compile the cl program.

    We work on test machine which is exactly same as the production machine.
    we change program, in our machine(which has copy of all the programs and file of production)  then promote it  to production machine.

    It is working as desired in our test machine but throwing CPF3061(record format QWFHDML not found for EHUBTMP).

    Please advise on how can I achieve the desired result.

    210 pointsBadges:
    report
  • mohit123
    CL is working fine in test machine but throwing error in production.
    210 pointsBadges:
    report
  • ToddN2000
    Are you just moving the compiled object to production? Have you tried running de-bug on the object in production? When the production job halts in debug mode, look to see if the file is in the QTEMP library and what the record format name is? 

    In you program, you are declaring the file and then opening it.
    IF you are doing this from your test machine, the file will exist in your QTEMP library until you delete in or log off.

    If you try running this in production, the file does not exist yet.
    IT will not be created until you run your 
    dspfd file(ehub) type(*mbrlist) output(*outfile) outfile(qtemp/ehutmp)

    You may want to put this in another library other than QTEMP or move your declare and open AFTER your DSPFD command.
    136,470 pointsBadges:
    report
  • mohit123
    Yes we move the compile object to production and it replaces the already present object in prod.

    I have run the program in test machine when no file in qtemp exists.
    DSPFD creates the temp file in qtemp library.

    I dont understand why DSPFD is not creating the file in prod.

    I ran DSPFD only once while compiling the CL. and then on DSPFD creates outfile in qtemp itself(even when the ehutmp does not exist in qtemp lib.).

    please let me know if u r in facebook.
    We can have an interactive chat there.:)

    by the way thanks for taking this issue seriously.
    210 pointsBadges:
    report
  • Splat
    Are you certain about that message?  The first level text for CPF3601 is PTF &2 cannot be temporarily removed.  
    12,915 pointsBadges:
    report
  • mohit123
    sorry it was CPF3061.
    210 pointsBadges:
    report
  • Splat
    One technique I've found useful is to create a duplicate of the system file into QTEMP & load the date to that.
    F010:       DCLF       FILE(QaFdMbrL)   

    .
    .
    .

    F020: CRTDUPOBJ OBJ(QaFdMbrl) FROMLIB(*LIBL) OBJTYPE(*FILE) +
    TOLIB(QTEMP)
    MONMSG MSGID(CPF2130)

    CHGPF FILE(QTEMP/QaFdMbrl) MAXMBRS(*NOMAX) +
    SIZE(*NOMAX)

    .
    .
    .

    F030: DSPFD FILE(&Library/&File) TYPE(*MBRLIST) +
    OUTPUT(*OUTFILE) OUTFILE(QTEMP/QAFDMBRL) +
    OUTMBR(&Library)
    MONMSG MSGID(CPF3000) EXEC(RETURN)

    OVRDBF FILE(QAFDMBRL) TOFILE(QTEMP/QAFDMBRL) +
    MBR(&Library) SHARE(*YES)

    F031: RCVF RCDFMT(QWHFDML)

    .
    .
    .
    12,915 pointsBadges:
    report
  • pdraebel
    When using commands in CL that output to a data base file I usually do a DCLF of the system Model file for that command. The output is directed to any file name you can come up with and before issuing the first RCVF issue an override of the system model file to the file name you used. This avoids issues in compiles and such.
    7,545 pointsBadges:
    report
  • ToddN2000
    If this going to be a regularly scheduled job, why not put the files in a regular library instead of QTEMP ?  This way you can be sure the file object is always there.
    136,470 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.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: