Zdenko Said:
What I want to do is: 1. to create *USRSPC
Creating a user
index might be the best way. It will sort itself based on the key you
define. Sorting a User Space Would have to be done manually as far as I know,
but using a User Index is Pretty nifty.
CrtUsIApi
PR
ExtPgm('QUSCRTUI')
D
IndexName
20A
D
ExtndAttr
10A
D
LngthAttr
1A
D
Length
10I
0
D
KeyInsert
1A These
two field values determine how the index will be
sorted
D
KeyLen
10I
0
<===== To the best of my recollection...
D
ImmUpd
1A
I would certainly drag out the old docs for a good perusal before
proceeding
D
Optimiz
1A
D
PubAuth
10A
D
Descript
50A
D
Replace
10A
D
IndexErrC
Like(ErrorCode)
D
IndexDom
10A
*----------------------------------------------------------------
* Error Parm Definition For API
Calls
*----------------------------------------------------------------
D ErrorParm
DS
D
BytPrv
10I 0 INZ(*ZERO) OverLay(ErrorParm:1)
D
BytAvl
10I 0 INZ(*ZERO) OverLay(ErrorParm:5)
D
MsgId
7A INZ(*BLANKS) OverLay(ErrorParm:9)
D
Rsrvd
1A INZ(*BLANKS) OverLay(ErrorParm:16
D
MsgDta
512A INZ(*BLANKS) OverLay(ErrorParm:17
D
ErrorCode
528
OverLay(ErrorParm:1)
2. to fill *USRSPC with data (records vary, for instance let it be 20)
*
-------------------------------------------------------
*
Api (QUsAddUi)
ProtoTypes
* -------------------------------------------------------
D
AddUsIApi
PR
ExtPgm('QUSADDUI')
D
RetLibName
10A
D
NumEntAdded
10I
0
D
UserIndName
20A
D
InsertTyp
10I
0
D
Entries
120A
D
EntLen
10I
0
D
EntArr
8A
Dim(100)
D
EntNum
10I
0
D
IndexErrC
Like(ErrorCode)
3. to sort *USRSPC (if possible by – cInvName+dInvDate)
See above key
reference
4. to read sorted data from *USRSPC and put them on *SPLF
*
---------------------------------------------------------------
*
Api (QUsRtvUi)
ProtoTypes
* ---------------------------------------------------------------
* From the IBM manual "OS/400 Object APIs V4R3"
:
* Receiver Variable size is 8 + (max # of entries * max entry
length)
D RtvUsIApi
PR
ExtPgm('QUSRTVUI')
D
Receiver
128A
D
RcvLen
10I
0
D
EntArr
8A
Dim(1)
D
EntLen
10I
0
D
EntNum
10I
0
D
RtnLibNam
10A
D
IndexName
20A
D
Format
8A
D
MaxRcv
10I
0
D
SearchTyp
10I
0
D
SearchCri
120A
D
CriLen
10I
0
D
SearchOS
10I
0
D
IndexErrC
Like(ErrorCode)
5. to clear *USRSPC
----- Original Message -----
Sent: Wednesday, April 11, 2001 5:47
AM
Subject: USERSPACE
Need help for using *USRSPC
What I want to do is: 1. to create *USRSPC
2. to fill *USRSPC with data (records vary, for instance let it be 20)
3. to sort *USRSPC (if possible by – cInvName+dInvDate)
4. to read sorted data from *USRSPC and put them on *SPLF
5. to clear *USRSPC
Thanks in advance
Zdenko