ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

How can i retrieve the latest spool file from a job?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #31
    Re: How can i retrieve the latest spool file from a job?

    the command GETLASTSPL is not working , it is saying erron in command GETLASTSPL. kindly suggest alternative solution.
    thanks a ton for your support

    Comment


    • #32
      Re: How can i retrieve the latest spool file from a job?

      you have to have the complete job information (Job name, user, and job number) for it to work. i still don't see why anyone would object to wrapping the call to the program in a CL...
      I'm not anti-social, I just don't like people -Tommy Holden

      Comment


      • #33
        Re: How can i retrieve the latest spool file from a job?

        sorry to ask you again n again
        I gave job name ,user and all . still i am getting ERROR

        PGM
        DCL VAR(&RTN) TYPE(*CHAR) LEN(100)
        DCL VAR(&JOBNAM) TYPE(*CHAR) LEN(10)
        DCL VAR(&JOBUSR) TYPE(*CHAR) LEN(10)
        DCL VAR(&JOBNBR) TYPE(*CHAR) LEN(10)
        RTVJOBA JOB(&JOBNAM) USER(&JOBUSR) NBR(&JOBNBR)
        CHGVAR VAR(&RTN) VALUE(' ')
        /* MONMSG MSGID(CPF0811) */
        RTVDTAARA DTAARA(RAILLAB/SP1) RTNVAR(&RTN)
        MONMSG MSGID(CPF0001)
        GETLASTSPL JOB(310555/RAILLAB/S3059999S1) SPLF(SPOOL2) +
        USER(RAILLAB) SPLNBR(310555)
        ENDPGM

        Comment


        • #34
          Re: How can i retrieve the latest spool file from a job?

          the error is that the user and splnbr keywords are returned values and need to be variables and you are passing constants. the routine is to return the last spooled file's number right? then how are you going to retrieve that number if you are passing a constant? you should only have to pass the job info and the spooled file name and the user and last spooled file number will be returned from the command...think of it as a RTV command. ( i should have compiled it to only run in a program call...)
          I'm not anti-social, I just don't like people -Tommy Holden

          Comment

          Working...
          X