Sunteți pe pagina 1din 4

***********************************************************

* Prototype for QUSCRTUS - Create User Space


*
***********************************************************
D QUSCRTUS
PR
ExtPgm('QUSCRTUS')
D UserSpace
20a const
D Attrib
10a const
D InitSize
10i 0 const
D InitVal
1A const
D PubAuth
10a const
D Text
50a const
* optional group 1:
D Replace
10a const options(*nopass)
D ErrorCode
like(MyErrCode)
D
options(*varsize: *nopass)
* optional group 2:
D Domain
10a const options(*nopass)
* optional group 3:
D XferSizeReq
10i 0 const options(*nopass)
D OptAlign
1A const options(*nopass)
***********************************************************
* Prototype for QSRLSAVF - List Save File
*
***********************************************************
D QSRLSAVF
PR
ExtPgm('QSRLSAVF')
D UserSpace
20a const
D Format
8a const
D SaveFile
20a const
D NameFilter
10a const
D TypeFilter
10a const
D ContHandle
36a const
D ErrorCode
like(MyErrCode)
D
options(*varsize: *nopass)
***********************************************************
* Prototype for QUSPTRUS - Retrieve Pointer to User Space *
***********************************************************
D QUSPTRUS
PR
ExtPgm('QUSPTRUS')
D UserSpace
20a const
D Format
*
D ErrorCode
like(MyErrCode)
D
options(*varsize: *nopass)
***********************************************************
* Prototype for QUSRTVUS - Retrieve User Space
*
***********************************************************
D QUSRTVUS
PR
ExtPgm('QUSRTVUS')
D UserSpace
20a const
D StartPos
10i 0 const
D Length
10i 0 const
D UsrSpcData
203a const
D ErrorCode
like(MyErrCode)
D
options(*varsize: *nopass)
***********************************************************
* Prototype for QWCCVTDT - Convert Date and Time Format *
***********************************************************
D QWCCVTDT
PR
ExtPgm( 'QWCCVTDT' )
D CvtInputFmt
10
D CvtInputDate
17
D CvtOutputFmt
10

D CvtOutputDate
D ErrorCode
D
D
D
D
D

InputFmt
InputDate
OutputFmt
OutputDate

17
like(MyErrCode)
options(*varsize: *nopass)
S
S
S
S

10
17
10
17

***********************************************************
* API error code data structure
*
***********************************************************
D MyErrCode
DS
D BytesProv
10i 0 inz(%size(MyErrCode))
D BytesAvail
10i 0 inz(0)
D MsgID
7a
D Reserved
1a
D MessageData
512a
***********************************************************
* Header Definition
*
***********************************************************
dListHdr
DS
based(HdrPtr)
d
124a
d OffLstEnt
10i 0
d SizDtaSec
10i 0
d NbrLstEnt
10i 0
d SizLstEnt
10i 0
d UsrSpc
d ErrCod

S
S

d Savf
d SavfName
d SavfLib

DS

d
d
d
d
d
d
d
d
d
d
d
d
d
d
d
d
d
d
d
d

DS

SAVF0100

10a
10a

LibName
SavCmd
SavDT
SavASP
Rcds
SavObj
SavAcp
SavAct
RlsLvl
DtaCpd
SysSRLn
PrvAut

MbrLibSav
SplFilSav
SyncID

inz('MySAVF')
inz('MyLib')
based(ListPtr)
qualified

10a
10a
8a
10i
10i
10i
10i
10a
6a
1a
8a
1a
2a
10a
2a
10i
10i
10a

ASPDevNm

d SAVF0200
d
d ObjName

20a inz('USRSPC
10i 0 inz(0)

DS

0
0
0
0

0
0
based(ListPtr)
qualified

10a

QTEMP

')

d
d
d
d
d
d
d
d
d
d
d
d
d

LibName
ObjType
ObjAttr
SavDate
ObjSize
ObjSzMl
StgPool
DatSave
ObjOwnr
DloName
FdrName
Descrip
DevName

10a
10a
10a
8a
10i 0
10i 0
10i 0
1a
10a
20a
63a
50a
10a

***********************************************************
* Work Fields
*
***********************************************************
d FmtName
S
8a inz('SAVF0100')
d UsSize
S
10i 0
d Handle
S
36a
d EntryNo
S
10i 0
***********************************************************
* Create User Space for API Usage
*
***********************************************************
c
if
FmtName = 'SAVF0100'
c
eval
UsSize = %size(SAVF0100) * 1024
c
else
c
eval
UsSize = %size(SAVF0200) * 1024
c
endif
c
c
c
c
c
c
c
c

callp

QUSCRTUS(
:
:
:
:
:
:
:

UsrSpc
' '
%size(UsSize)
x'00'
'*USE'
'Save File Information'
'*YES'
MyErrCode)

***********************************************************
* List Save File Details
*
***********************************************************
c
callp
QSRLSAVF( UsrSpc
c
: FmtName
c
: Savf
c
: '*ALL'
c
: '*ALL'
c
: Handle
c
: MyErrCode )
***********************************************************
* Retrieve Pointer to User Space
*
***********************************************************
c
callp
QUSPTRUS( UsrSpc
c
: HdrPtr
c
: MyErrCode)
c
c

for
eval

EntryNo = 0 to (NbrLstEnt - 1)
ListPtr = HdrPtr + OffLstEnt +

(SizLstEnt * EntryNo)
**** DO STUFF HERE

if
FmtName = 'SAVF0100'
* All the SAVF0100 stuff is in the qualified SAVF0100 DS
c
Eval
InputFmt = '*DTS'
c
Eval
InputDate = SAVF0100.SavDT
c
Eval
OutputFmt = '*YYMD'
c
c
c
c
c

Callp

QWCCVTDT (InputFmt :
InputDate :
OutputFmt :
OutputDate:
MyErrCode )

c
c

dsply
OutPutDate
else
* All the SAVF0200 stuff is in the qualified SAVF0200 DS
*
...
c
endif
c

endfor

c
c

seton
return

lr

S-ar putea să vă placă și