IBM Version 4 Universal Remote User Manual


 
Manipulating a User Space without Pointers
Changing a User Space with an ILE RPG Program—Example
To change the user area of a user space as shown in the previous example with a
call from an ILE RPG program, specify the following:
Hᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍ
H
Hᑍ PROGRAM: CHANGUSPTR
H
Hᑍ LANGUAGE: ILE RPG for OS/4
H
Hᑍ DESCRIPTION: CHANGE THE CONTENTS OF INFORMATION IN THE USER
Hᑍ AREA IN THE USER SPACE USING A POINTER
H
Hᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍ
D
DUSRSPCNAM S 2 INZ('TEMPSPACE QTEMP ')
DNEWVALUE S 64 INZ('Big String padded with blanks')
DUSRSPCPTR S
DUSERAREA DS BASED(USRSPCPTR)
D CHARFIELD 1 64
D
Dᑍ Following QUSEC structure copied from QSYSINC library
D
DQUSEC DS
Dᑍ Qus EC
D QUSBPRV 1 4B 
Dᑍ Bytes Provided
D QUSBAVL 5 8B 
Dᑍ Bytes Available
D QUSEI 9 15
Dᑍ Exception Id
D QUSERVED 16 16
Dᑍ Reserved
Dᑍ End of QSYSINC copy
D
C
Cᑍ Initialize Error code structure to return error ids
C
C Z-ADD 16 QUSBPRV
C
Cᑍ Set USRSPCPTR to the address of the User Space
C
C CALL 'QUSPTRUS'
C PARM USRSPCNAM
C PARM USRSPCPTR
C PARM QUSEC
C
Cᑍ Check for successful setting of pointer
C
C QUSBAVL IFGT
C
Cᑍ If an error, then display the error message id
C
C DSPLY QUSEI
C ELSE
C
Cᑍ Otherwise, update the User Space via the based structure
C
C MOVEL NEWVALUE USERAREA
C END
C
Cᑍ And return to our caller
C
C SETON LR
C RETURN
2-20 System API Programming V4R1