|
here is what i use. it is a little spool list utility. Hope this help. ----- Original Message ----- From: "Pete Helgren" <Pete@xxxxxxxxxx> To: "RPG Midrange Discussion" <rpg400-l@xxxxxxxxxxxx> Sent: Friday, January 27, 2006 12:02 AM Subject: Prompting for Spool Files > I have collected several utilities that, in one way or another, work > with spool files. None of them, however, have a "prompt" capability > where you can hit the F4 key and select from a list of spool files by > user or outq. > > Before I write my own, does anybody have an RPG program that does this > already? Some of these utilities are great but having to know the Job > Name, User, Number and Spool file number is a pain. I am looking for a > program that I can call that will list/page through spool files and then > will retrieve the Job Name, User ID, Job Number and Spool File number. > > Even something close would be a help. > > Pete Helgren > > -- > This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list > To post a message email: RPG400-L@xxxxxxxxxxxx > To subscribe, unsubscribe, or change list options, > visit: http://lists.midrange.com/mailman/listinfo/rpg400-l > or email: RPG400-L-request@xxxxxxxxxxxx > Before posting, please take a moment to review the archives > at http://archive.midrange.com/rpg400-l. > >
?*
____________________________________________________________________________________________
?* Spoules : liste des spoules dans USRSPACE
?* PR are used in a /copy but included here
?*
____________________________________________________________________________________________
H DEBUG DATEDIT(*DMY) DECEDIT('0,')
?*
____________________________________________________________________________________________
?* DEFINITIONS DE ZONES
?*
____________________________________________________________________________________________
?*
?* DS système
.................................................................................
D SDS
D SysPgm 1 10
Programme
D SysJob 244 253
Travail
D SysUsr 254 263
Utilisateur
D SysJnum 264 269
N° job
D SysSts *STATUS
Etat
?*
?* Variable globales
..........................................................................
D SysDatHeu S 14 0
Date/heure
D SysJma S 8 0
Date sys (jjmmaaaa)
D SysJjmmaa S 6 0
Date sys (jjmmaa)
D SysAmj S 8 0
Date sys (aaaammjj)
D SysHeu S 6 0
Heure sys (hhmmss)
D LockRcd S 1
Verouillage enreg
?*
____________________________________________________________________________________________
?* Création espace utilisateur
?*
____________________________________________________________________________________________
D QUSCRTUS pr Extpgm('QUSCRTUS')
d QualName 20 Const
d ExtAttr 10 Const
d InitSize 10u 0 Const
d InitValue 1 Const
d Authority 10 Const
d Text 50 Const
d Replace 10 Const
d Error 272
d Domain 10 Const
?*
____________________________________________________________________________________________
?* Lecture UserSpace
?*
____________________________________________________________________________________________
d QUSRTVUS pr ExtPgm('QUSRTVUS')
d QualName 20 Const
d StartPos 10u 0 Const
d Length 10u 0 Const
d RcvData 32767 Const Options(*VarSize)
d Error 272
?*
____________________________________________________________________________________________
?* Ecriture UserSpace
?*
____________________________________________________________________________________________
d QUSCHGUS pr ExtPgm('QUSCHGUS')
d QualName 20 Const
d StartPos 10u 0 Const
d Length 10u 0 Const
d SndData 32767 Const Options(*VarSize)
d Force 1 Const
d Error 272
?*
____________________________________________________________________________________________
?* Fonction : Création espace utilisateur
?*
____________________________________________________________________________________________
D CrtUsrSpcFram pr n
d Name 10 Value
d Lib 10 Value Options(*nopass)
d InitSize 10u 0 Value Options(*nopass)
d Text 50 Value Options(*nopass)
?*
____________________________________________________________________________________________
?* Fonction : Lecture UserSpace
?*
____________________________________________________________________________________________
D RtvUsrSpc pr 32767 Varying
d Name 10 Value
d StartPos 10u 0 Value
d Length 10u 0 Value
?* *RcvData 32767 Const Options(*nopass : *VarSize)
d Lib 10 Value Options(*nopass)
?*
____________________________________________________________________________________________
?* Fonction : Ecriture UserSpace
?*
____________________________________________________________________________________________
D ChgUsrSpc pr n
d Name 10 Value
d SndData 32767 Const Options(*VarSize)
d StartPos 10u 0 Value options(*nopass)
d Length 10u 0 Value options(*nopass)
d Lib 10 Value Options(*nopass)
?*
____________________________________________________________________________________________
?* Création espace utilisateur
?*
____________________________________________________________________________________________
D QMHRCVM pr Extpgm('QMHRCVM')
d RcvTxt 1024 Const Options(*VarSize)
d RcvLen 10u 0 Const
d FmtName 8 Const
d QualName 20 Const
d MsgTyp 10 Const
d MsgKey 4 Const
d WaitTime 10u 0 Const
d MsgAct 10 Const
d Error 272
?*
?* User Space
.................................................................................
d UsrspcNam s 10 Inz('SPLLST ')
d UsrSpcLib s 10 Inz('QTEMP')
d UsrSpcSiz s 10u 0 Inz(100000)
?*
?* Erreur Api
.................................................................................
D ApiError ds
D fld1 1 4b 0
D Fld2 5 8b 0
D Fld3 9 15
D Fld4 16 16
D Fld5 17 30
?*
?* En-tête Api de liste
.......................................................................
D SpcHeader ds
D Sph_1 1 64
D Sph_2 65 68b 0
D Sph_3 69 72
D Sph_4 73 80
D Sph_5 81 90
D Sph_6 91 103
D Sph_7 104 104
D Sph_8 105 108b 0
D Sph_9 109 112b 0
D Sph_10 113 116b 0
D Sph_11 117 120b 0
D Sph_12 121 124b 0
D Sph_Offset 125 128b 0
D Sph_Size 129 132b 0
D Sph_Entries 133 136b 0
D Sph_EleLen 137 140b 0
?*
D Strpos s 9b 0
D £Max s 5 0
D Lendata s 10u 0
?* ________________________________________________________________________
?* Paramètres
?* ________________________________________________________________________
c *Entry Plist
?
c Parm ££Outq 10
?
c Parm ££User 10
?
c Parm £max
?
?*
________________________________________________________________________?
?* Traitement
?
?*
________________________________________________________________________?
?* Creation espace utilisateur
............................................?
c Callp CrtUsrSpcFram
?
c (UsrSpcNam:UsrSpcLib:UsrSpcSiz)
?
?*
?
?* Api fichiers spoule
....................................................?
c Eval Ap1 = UsrSpcNam+UsrSpcLib
?
c Eval Ap2 = 'SPLF0300'
?
c If ££Outq<>' '
?<---1---------+
c and ££OUTQ <>'*ALL'
? |
c Eval Ap4 = ££Outq + '*LIBL'
? |
c Else
? -X
c If ££Outq<>' '
?<---2--------+|
c Eval Ap4 = '*ALL'
? ||
c Endif
?<---2--------+|
c Endif
?<---1---------+
c If ££User<>' '
?<---1---------+
c Eval Ap3 = ££User
? |
c Else
? -X
c Eval Ap3 = '*ALL'
? |
c Endif
?<---1---------+
c Eval Ap5 = '*ALL'
?
c Eval Ap6 = '*ALL'
?
c Eval Sph_entries = 0
?
?*
?
?* Liste des spoules
......................................................?
c Clear ApiError
?
c Call(e) 'QUSLSPL'
?
c parm Ap1 20
?
c parm Ap2 8
?
c parm Ap3 10
?
c parm Ap4 20
?
c parm Ap5 10
?
c parm Ap6 10
?
c parm Apierror
?
?*
?
c If Fld3 =' '
?<---1---------+
c and not %error
? |
c Eval Strpos = 1
? |
c Eval LenData = 140
? |
c Call 'QUSRTVUS'
? |
c Parm Ap1
? |
c Parm Strpos
? |
c Parm Lendata
? |
c Parm SpcHeader
? |
c Endif
?<---1---------+
?*
?
c Eval £Max = Sph_Entries
?
?*
?
C Return
?
**********************************************************************************************
* Source of the module used in a service programm
**********************************************************************************************
H Nomain
?*
____________________________________________________________________________________________
?* Création espace utilisateur
?*
____________________________________________________________________________________________
D QUSCRTUS pr Extpgm('QUSCRTUS')
d QualName 20 Const
d ExtAttr 10 Const
d InitSize 10u 0 Const
d InitValue 1 Const
d Authority 10 Const
d Text 50 Const
d Replace 10 Const
d Error 272
d Domain 10 Const
?*
____________________________________________________________________________________________
?* Lecture UserSpace
?*
____________________________________________________________________________________________
d QUSRTVUS pr ExtPgm('QUSRTVUS')
d QualName 20 Const
d StartPos 10u 0 Const
d Length 10u 0 Const
d RcvData 32767 Const Options(*VarSize)
d Error 272
?*
____________________________________________________________________________________________
?* Ecriture UserSpace
?*
____________________________________________________________________________________________
d QUSCHGUS pr ExtPgm('QUSCHGUS')
d QualName 20 Const
d StartPos 10u 0 Const
d Length 10u 0 Const
d SndData 32767 Const Options(*VarSize)
d Force 1 Const
d Error 272
?*
____________________________________________________________________________________________
?* Fonction : Création espace utilisateur
?*
____________________________________________________________________________________________
D CrtUsrSpcFram pr n
d Name 10 Value
d Lib 10 Value Options(*nopass)
d InitSize 10u 0 Value Options(*nopass)
d Text 50 Value Options(*nopass)
?*
____________________________________________________________________________________________
?* Fonction : Lecture UserSpace
?*
____________________________________________________________________________________________
D RtvUsrSpc pr 32767 Varying
d Name 10 Value
d StartPos 10u 0 Value
d Length 10u 0 Value
?* *RcvData 32767 Const Options(*nopass : *VarSize)
d Lib 10 Value Options(*nopass)
?*
____________________________________________________________________________________________
?* Fonction : Ecriture UserSpace
?*
____________________________________________________________________________________________
D ChgUsrSpc pr n
d Name 10 Value
d SndData 32767 Const Options(*VarSize)
d StartPos 10u 0 Value options(*nopass)
d Length 10u 0 Value options(*nopass)
d Lib 10 Value Options(*nopass)
?*
____________________________________________________________________________________________
?* Création espace utilisateur
?*
____________________________________________________________________________________________
D QMHRCVM pr Extpgm('QMHRCVM')
d RcvTxt 1024 Const Options(*VarSize)
d RcvLen 10u 0 Const
d FmtName 8 Const
d QualName 20 Const
d MsgTyp 10 Const
d MsgKey 4 Const
d WaitTime 10u 0 Const
d MsgAct 10 Const
d Error 272
?*
____________________________________________________________________________________________
?* Variables Diverses
?*
____________________________________________________________________________________________
d QualName s 20
d ExtAttr s 10
d InitSize s 10u 0
d InitValue s 1
d Authority s 10
d Text s 50
d Replace s 10
d StartPos s 10u 0
d Length s 10u 0
d RcvData s 32767
d SndData s 32767
d Domain s 10
d RcvTxt s 1024
d RcvLen s 10u 0 inz(1024)
?*
____________________________________________________________________________________________
?* Valeurs par défaut
?*
____________________________________________________________________________________________
d DfLib s 10 inz('QTEMP')
d DfExtAttr s 10 inz(' ')
D DfInitSize s 10u 0 inz(100000)
d dfInitValue s 1 inz(x'00')
d dfAuthority s 10 inz('*ALL')
d dfText s 50 inz(' ')
d dfReplace s 10 inz('*YES')
d dfStartPos s 10u 0 inz(1)
d dfLength s 10u 0 inz(32767)
d dfDomain s 10 inz('*USER')
d DfForce s 1 inz('2')
d DfData s 32767
?*
____________________________________________________________________________________________
?* Valeurs par défaut message
?*
____________________________________________________________________________________________
d DftAct s 10 inz('*REMOVE ')
d DftFmt s 8 inz('RCVM0100')
d DftTyp s 10 inz('*ANY ')
d DftKey s 4 inz(' ')
d DftWait s 10u 0 inz(0)
d DftLib s 10 inz('*LIBL ')
?*
d WAct s 10
d WKey s 4
d WLib s 10
?*
D ApiError ds
D Bytesavail 10u 0 inz(%size(ApiError))
D Bytesused 10u 0
D ExcptId 7
D ExcptId2 1
D ExcptDta 256
?*
____________________________________________________________________________________________
?* Creation espace utilisateur
?*
____________________________________________________________________________________________
P CrtUsrSpcFram B Export
D PI n
d pName 10 Value
d pLib 10 Value Options(*nopass)
d pInitSize 10u 0 Value Options(*nopass)
d pText 50 Value Options(*nopass)
?*
c If %parms<2
?<---1---------+
c Eval QualName = PName + DfLib
? |
c Else
? -X
c Eval QualName = PName + Plib
? |
c Endif
?<---1---------+
?*
?
?* Ne créer que si n'existe pas
...........................................?
c Eval $Lib = %subst(QualName : 11 : 10)
?
c Eval $Obj = %subst(QualName : 1 : 10)
?
c Call '£_CHKOBJ'
?
c Parm $Obj 10
?
c Parm $Lib 10
?
c Parm '*USRSPC' $Typ 10
?
c Parm ' ' $Ret 1
?
c If $Ret = '0'
?<---1---------+
?*
? |
c If %parms<3
?<---2--------+|
c Eval InitSize = DfInitSize
? ||
c Else
? -X|
c Eval InitSize = PInitSize
? ||
c Endif
?<---2--------+|
?*
? |
c If %parms<4
?<---2--------+|
c Eval Text = DfText
? ||
c Else
? -X|
c Eval Text = PText
? ||
c Endif
?<---2--------+|
?*
? |
c Callp QUSCRTUS(
? |
c QualName :
? |
c dfExtAttr :
? |
c InitSize :
? |
c dfInitValue:
? |
c dfAuthority:
? |
c Text :
? |
c dfReplace :
? |
c ApiError :
? |
c dfDomain)
? |
?*
? |
c If BytesUsed > 0
?<---2--------+|
c Return *off
? ||
c Else
? -X|
c Return *on
? ||
c Endif
?<---2--------+|
?*
? |
c Else
? -X
c Return *on
? |
c Endif
?<---1---------+
?*
?
P E
?
?*
________________________________________________________________________?
?* Ecriture dans espace utilisateur
?
?*
________________________________________________________________________?
P ChgUsrSpc B Export
?
D PI n
?
d pName 10 Value
?
d pData 32767 Const options(*varsize)
?
d pStart 10u 0 Value options(*nopass)
?
d pLenght 10u 0 Value options(*nopass)
?
d pLib 10 Value options(*nopass)
?
?*
?
c If %parms<5
?<---1---------+
c Eval QualName = PName + DfLib
? |
c Else
? -X
c Eval QualName = PName + Plib
? |
c Endif
?<---1---------+
c If %parms<4
?<---1---------+
c Eval plenght=%len(%trimr(pdata))
? |
c Endif
?<---1---------+
c If %parms<3
?<---1---------+
c Eval pstart=1
? |
c Endif
?<---1---------+
?*
?
c Callp QUSCHGUS(
?
c QualName :
?
c Pstart :
?
c Plenght :
?
c Pdata :
?
c DfForce :
?
c ApiError )
?
?*
?
?* Créer si existe pas
....................................................?
c If ExcptId = 'CPF9801'
?<---1---------+
c Callp CrtUsrSpcFram(Pname)
? |
c Callp QUSCHGUS(
? |
c QualName :
? |
c Pstart :
? |
c Plenght :
? |
c Pdata :
? |
c DfForce :
? |
c ApiError )
? |
c endif
?<---1---------+
?*
?
c If BytesUsed > 0
?<---1---------+
c Return *off
? |
c Else
? -X
c Return *on
? |
c Endif
?<---1---------+
?*
?
P E
?
?*
________________________________________________________________________?
?* Lecture dans espace utilisateur
?
?*
________________________________________________________________________?
P RtvUsrSpc B Export
?
D PI 32767 Varying
?
d pName 10 Value
?
d pStart 10u 0 Value
?
d pLenght 10u 0 Value
?
d pLib 10 Value options(*nopass)
?
?*
?
c If %parms<4
?<---1---------+
c Eval QualName = PName + DfLib
? |
c Else
? -X
c Eval QualName = PName + Plib
? |
c Endif
?<---1---------+
c Eval DfData = ' '
?
?*
?
c Callp QUSRTVUS(
?
c QualName :
?
c Pstart :
?
c Plenght :
?
c DfData :
?
c ApiError )
?
?*
?
c Return DfData
?
?*
?
P E
?
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.