ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Copy spoolfile using QSPGETF

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Copy spoolfile using QSPGETF

    Hi All,


    I am trying to copy a spoolfile to a PF using program QSPGETF
    However, i keep getting an error message:

    CPF3303 File WMR981P1 not found in job 602218/RSANDBRINK/PRT_MODOC

    The spoolfile does exist:

    Job . . . . . . . . : PRT_MODOC File . . . . . . . . : WMR981P1
    User . . . . . . . : RSANDBRINK Number . . . . . . : 000004
    Number . . . . . . : 602218 Creation date . . . : 21/07/08

    I have tried several things:

    1. Using command:

    GETSPLF FILE(WMR981P1) JOB(602218/RSANDBRINK/PRT_MODOC) SPLNBR(4)

    2. calling the QSPGETF in a CL variable spoolnumber

    DCL &Spfn *CHAR 6 /*Spool file no*/
    DCL &Spfn_Bin *CHAR 2 /* Spool file.(B2)*/

    CHGVAR %BIN(&Spfn_bin) (&Spfn)

    CALL QSPGETF PARM(&Spoolfile &FileAndLib &Job &Spfn_Bin &Mbr)

    3. Hardcoded:

    CALL PGM(QSYS/QSPGETF) PARM('WMR981P1 ' 'P132 SANDBRINK ' 'PRT_MODOC RSANDBRINK602218' X'0004' 'P132 ')


    All with the same result.
    Can anyone tell me what i am doing wrong?

    Thanks in advance

    Regards,
    Rob Sandbrink

  • #2
    Re: Copy spoolfile using QSPGETF

    if you look closer at the API the first parameter is a spooled file handle not a spooled file name. to get the handle to the spooled file you need to call the Open Spooled File (QSPOPNSP) API first then use the handle retrieved on your call to the QSPGETSP API.
    I'm not anti-social, I just don't like people -Tommy Holden

    Comment


    • #3
      Re: Copy spoolfile using QSPGETF

      why not use the good old CPYSPLF.
      Hunting down the future ms. Ex DeadManWalks. *certain restrictions apply

      Comment


      • #4
        Re: Copy spoolfile using QSPGETF

        Hi there, Tomholden and DeadManWalks

        I am going to check on the "Spoolfile handle" first thing in the morning. its something i havent heard of before.

        And good old CPYSPLF does not let me copy *AFPDS printerfiles.

        Comment


        • #5
          Re: Copy spoolfile using QSPGETF

          Hi,

          what's the release you are working on?

          QSPGETF and QSPPUTF are no APIs.
          Please check out the following technical document:
          Using the GETSPLF and PUTSPLF Print Utilities (R510 through R530)


          Birgitta

          Comment


          • #6
            Re: Copy spoolfile using QSPGETF

            not sure about AFPDS (most of our crap is 1960's COBOL) we don't have anything created for AFPDS or IPDS for that matter. but i threw together a DUPSPLF command. note there's some functionality that should be added but for now it's the Q&D version.
            tommyholden.com/downloads/save files/dupsplf.savf

            ok...it was easier than i thought. now the "New User" and OUTQ keywords work. there's not a VCP for the command as of yet...may never be lol...

            but pass in a valid qualified job, spooled file name and spooled file number(or *LAST) and it will duplicate the spooled file...this sounded fun and i had a little free time (yeah right...) enjoy.
            Last edited by tomholden; July 21, 2008, 02:50 PM.
            I'm not anti-social, I just don't like people -Tommy Holden

            Comment


            • #7
              Re: Copy spoolfile using QSPGETF

              Thank you Birgitta,

              The link you provided me was the missing link. The problem was that i was using *INT2 iso INT4 for the spoolfile number parameter.

              All othters, thanks for your responses.

              Regards,
              Rob Sandbrink

              Comment

              Working...
              X