|
On Tue, 2002-04-02 at 11:13, Philipp Rusch wrote:
[snip]
Hi Philipp
This is the CHKTMPSTG routine I mentioned. Just compile & call it.
Change the size threshold (scan on L_KeyValue) from 50Mb to whatever
value seems useful.
Regards, Martin
**********************************************************************************************
* CHKTMPSTG: Check jobs for Temporary storage over 50Mb
**********************************************************************************************
**********************************************************************************************
* Data Structures
**********************************************************************************************
* Standard error code DS for API error handling
D Error_Code DS
D BytesProvd 10I 0 INZ(0)
D BytesAvail 10I 0 INZ(0)
D Except_ID 7
D Reserved 1
D Exception 256
* Receiver value DS for user space header info (used in first call to
QUSRTVUS)
D GenRcvrDS DS
D UserArea 64
D GenHdrSize 10I 0
D StrucLevel 4
D FormatName 8
D APIUsed 10
D CreateStamp 13
D InfoStatus 1
D SizeUsUsed 10I 0
D InpParmOff 10I 0
D InpParmSiz 10I 0
D HeadOffset 10I 0
D HeaderSize 10I 0
D ListOffset 10I 0
D ListSize 10I 0
D ListNumber 10I 0
D EntrySize 10I 0
*****************************************************************
* Type Definition for the JOBL0100 format.
*****************************************************************
D ListDataDS DS
D L_JobName 10
D L_JobUser 10
D L_JobNbr 6
D L_JobIdent 16
D L_Status 10
D L_JobType 1
D L_JobSubTy 1
D L_Reserved 2
D L_JobInfoSts 1
D L_Reserved2 3
D L_NbrFldsRtn 10I 0
D L_LenInfoRtn 10I 0
D L_KeyFld 10I 0
D L_DataType 1
D L_Reserved3 3
D L_LenDataRtn 10I 0
D L_KeyValue 10I 0
**********************************************************************************************
* Field definitions
**********************************************************************************************
D DataLength S 10I 0 INZ(140)
D CurrentEnt S 5P 0 INZ(1)
D ExtendAttr S 10 INZ('USRSPC ')
D InitialSiz S 10I 0 INZ(1024)
D InitialVal S 1 INZ(X'00')
D JobStatus S 10 INZ('*ACTIVE ')
D JobType S 1 INZ('*')
D ListFormat S 8 INZ('JOBL0200')
D NbrToRtn S 10I 0 INZ(1)
D KeysToRtn S 10I 0 INZ(2009)
D P_DataLength S 10I 0
D P_MsgData S 512
D P_MsgFile S 20 INZ('QCPFMSG *LIBL')
D P_MsgID S 7 INZ('CPDA0FF')
D P_MsgKey S 4
D P_MsgType S 10
D P_PgmQueue S 10
D P_PgmStack S 10I 0
D PublicAut S 10 INZ('*ALL ')
D QualifyJob S 26 INZ('*ALL *ALL *ALL ')
D ReplaceSpc S 10 INZ('*YES ')
D StartPos S 10I 0 INZ(1)
D TextDescrp S 50 INZ('User space for List Job API')
D UserSpace S 20 INZ('CHKTMPSTG QTEMP ')
**********************************************************************************************
* MAINLINE:
**********************************************************************************************
* Create a user space to hold the job list entries
C CALL 'QUSCRTUS'
C PARM UserSpace
C PARM ExtendAttr
C PARM InitialSiz
C PARM InitialVal
C PARM PublicAut
C PARM TextDescrp
C PARM ReplaceSpc
C PARM Error_Code
* List all the jobs on the system
C CALL 'QUSLJOB'
C PARM UserSpace
C PARM ListFormat
C PARM QualifyJob
C PARM JobStatus
C PARM Error_Code
C PARM JobType
C PARM NbrToRtn
C PARM KeysToRtn
* Get the header info for this space
C CALL 'QUSRTVUS'
C PARM UserSpace
C PARM StartPos
C PARM DataLength
C PARM GenRcvrDS
C PARM Error_Code
* Check to see if any entries returned
B001 C IF ListNumber > 0
* Set the initial offset for the start of the list entries
C EVAL ListOffset = ListOffset + 1
* Loop through the entries held in the list section of the user space
B002 C DOW CurrentEnt <= ListNumber
* Get the header info for this space
C CALL 'QUSRTVUS'
C PARM UserSpace
C PARM ListOffset
C PARM EntrySize
C PARM ListDataDS
C PARM Error_Code
*
B003 C IF L_KeyValue > 50
C EVAL P_MsgData = 'Job ' + L_JobNbr + '/' +
C %TRIM(L_JobUser) + '/' + %TRIM(L_JobName) +
C ' is using temp storage of ' +
C %EDITC(L_KeyValue : 'Z') + 'Mb'
C
C EVAL P_DataLength = 78
C EVAL P_PgmStack = 0
C EVAL P_PgmQueue = '*EXT'
C EVAL P_MsgType = '*INFO'
*
C CALL (E) 'QMHSNDPM'
C PARM P_MsgID
C PARM P_MsgFile
C PARM P_MsgData
C PARM P_DataLength
C PARM P_MsgType
C PARM P_PgmQueue
C PARM P_PgmStack
C PARM P_MsgKey
C PARM Error_Code
E003 C ENDIF
* Bump up the counter & offset for the next entry
C EVAL ListOffset = ListOffset + EntrySize
C EVAL CurrentEnt = CurrentEnt + 1
E002 C ENDDO
E001 C ENDIF
*
C EVAL *INLR = *ON
C RETURN
**********************************************************************************************
--
martin@dbg400.net jamaro@firstlinux.net http://www.dbg400.net
/"\
DBG/400 - DataBase Generation utilities - AS/400 / iSeries Open \
/
Source free test environment tools and others (file/spool/misc)
X
[this space for hire] ASCII Ribbon Campaign against HTML mail & news /
\
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.