Re: QSPRILSP



nangua wrote:
I'm trying to use the API, QSPRILSP. The compiler is choking on the
binder step. Anyhow, My job log states that a definition can't be
found for QSPRILSP. The API exists on our V5R2 machine as a *PGM.
No
module or srvpgm exists (that I know of) so that I can perform a
binding step. I've tried, in the prototype, to use EXTPGM (which seu
will not accept with a return variable). I've tried EXTPROC and I've
tried nothing in there. All to no avail. How can I get a definition
of this API visible to my compiler?? Thanks for any and all help.

What about a straight call?
The pgm pasted below calls the API and fills the data structure.
Then, the command changes the output to set the printer to #PRT

H DFTACTGRP(*NO) Option(*SrcStmt:*NoDebugIO)
************************************************************
? ?
* Printer
D #PRT S 10 INZ('PRT01')

*-------------------------------------------------------------------
* Change Spooled File Command - To build command
*
*
D SPL1 S 30 Inz('CHGSPLFA FILE(MYPRTFIL)
JOB(' )
D SPL2 S 10 INZ(') SPLNBR(')
D SPL3 S 10 INZ(') DEV(')
D SPL4 S 10 INZ(') ')
*
D QSPLLEN S 8B 0 inz(70)


,****************************************************************
,*Structure for SPRL0100 format - Get Last Spooled File of Pgm

,****************************************************************
DQSPL0100 DS
D* Qsp SPRL0100
D QSPBR03 1 4B 0
D* Bytes Return
D QSPBA03 5 8B 0
D* Bytes Avail
D QSPSN03 9 18
D* Splf Name
D SPJOB 19 28
D* Job Name
D SPUSR 29 38
D* Usr Name
D SPNUM 39 44
D* Job Number
D SPSPLNUM 45 48B 0
D* Splf Number
D QSPJSN 49 56
D* Job System Name
D QSPDFILO 57 63
D* Date File Open
D QSPERVED08 64 64
D* Reserved
D QSPTFILO 65 70
D* Time File Open

*Structure used to receive errors
DERRC001 DS
D QUMBERRBP 1 4B 0
D* Bytes Provided
D QUMBERRBA 5 8B 0
D* Bytes Available
D QUMBERREID 9 15
D* Exception ID
D QUMBERRRSV 16 16
D* Reserved
D QUMBERRDTA 17 216
D* Exception Data


C Call 'MYPRTPGMCL'
C Parm '00' ##RetCode 2

,*--------------------------------------------------------------------
,* Get Spool File data for Print Out
,* (webServer job swaps usernames etc so must use API )
,*
C CLEAR QSPL0100
C Call(E) 'QSPRILSP'
C Parm QSPL0100
C Parm QSPLLEN
C Parm 'SPRL0100' QSPLFMT 8
C Parm ERRC001

,*--------------------------------------------------------------------
,* Use Command to Change the Spool file attributes (to
Printer,etc)
,*
C EVAL #Cmd = %Trim(SPL1) +
C %TRIM(SPNUM) + '/' +
C %TRIM(SPUSR) + '/' +
C %TRIM(SPJOB) + %TRim(SPL2) +
C %TRIM(%CHAR(SPSPLNUM)) + %Trim(SPL3)
+
C %TRIM(#PRT) + %Trim(SPL4)
*
C CALL(E) 'QCMDEXC'
C PARM #Cmd 256
C PARM 256 #CmdLen 15 5
C
C EVAL *INLR = *ON
C RETURN

.



Relevant Pages

  • Re: system calls
    ... Writing a simple recursive file-deleter is fairly straightforward; ... If you really want to run a command line ... are better ways to do the operation from within the API, and be able to report to the user ... >I have looked at CreateProcess but found it complicated and unsatisfactory. ...
    (microsoft.public.vc.mfc)
  • RE: call rsh from .NET - source code?
    ... With an API? ... calling the command line from a command prompt. ... Yes, it is not an extremely sexy methodology, ...
    (microsoft.public.dotnet.framework)
  • Re: Get devd for an IPDS printer
    ... Go to the iSeries information center under programming and APIs you should find and API to list by printer device and use QDCRDEVD using format 1100 to capture the information for each printer and write to the IFS file. ... Alternatively you could dump stuff to spooled files using various CL commands with output. ... Be sure to use the QSPRILSP API to get the identity of the spooled file generated with the CL command or you will eventually run into problems. ...
    (comp.sys.ibm.as400.misc)
  • Re: [Python-Dev] PEP 324: popen5 - New POSIX process module
    ... With the current API, you do this by checking if the return code is 127. ... The shell uses these return codes: ... the command was found but is not executable ... If you look at the popen5 implementation and PEP, ...
    (comp.lang.python)
  • Re: Need RPGFREE help
    ... Prototype the printf() API ... Delete the QPRINT F-specs since you don't seem to be doing any I/O to it ... You should see the PRINTDEMO spooled file in the list of ...
    (comp.sys.ibm.as400.misc)