public function ReadUserSpace($frompos=1, $readlen = 0, $receiveStructure = null)
    {
        //how to see via green screen DSPF STMF('/QSYS.lib/qgpl.lib/ZS14371311.usrspc')

        $dataRead = ' ';
        $params[] = Toolkit::AddParameterChar('in', 20,  "User space name and library", 'userspacename', $this->getUSFullName());
        $params[] = Toolkit::AddParameterInt32('in',  "From position", 'position_from', $frompos);

        $receiverVarName = 'receiverdata';

        if ($receiveStructure) {
            // must be a ProgramParameter
            if (!is_object($receiveStructure)) {
                throw new \Exception('Parameter 3 passed to ReadUserSpace must be a ProgramParameter object.');
            }

            $labelForSizeOfInputData = 'dssize';
//
            $params[] = Toolkit::AddParameterSize("Length of data", 'dataLen', $labelForSizeOfInputData);

            // wrap simple ds around receive structure so we can assign a varname to retrieve later.
            $receiveDs[] = $receiveStructure;
            $params[] = Toolkit::AddDataStruct($receiveDs, $receiverVarName, 0, '', false, $labelForSizeOfInputData);

        } else {
            // regular readlen, no special structure or size labels.
            $params[] = Toolkit::AddParameterInt32('in',  "Size of data", 'datasize', $readlen);
            $params[] = Toolkit::AddParameterChar('out', $readlen, $receiverVarName, $receiverVarName, $receiveStructure);
        }

        $params[] = Toolkit::AddErrorDataStruct();

        $retPgmArr = $this->ToolkitSrvObj->PgmCall('QUSRTVUS', 'QSYS', $params);

        if ($this->ToolkitSrvObj->verify_CPFError($retPgmArr , "Read user space failed. Error:"))
            return false;
        $retArr = $retPgmArr['io_param'];

        // return our receiverstructure.
        return $retArr[$receiverVarName];
    }
public function ReadUserSpace($frompos=1, $readlen = 0, $receiveStructure = null)
    {
        //how to see via green screen DSPF STMF('/QSYS.lib/qgpl.lib/ZS14371311.usrspc')

        $dataRead = ' ';
        $params[] = Toolkit::AddParameterChar('in', 20,  "User space name and library", 'userspacename', $this->getUSFullName());
        $params[] = Toolkit::AddParameterInt32('in',  "From position", 'position_from', $frompos);

        $receiverVarName = 'receiverdata';

        if ($receiveStructure) {
            // must be a ProgramParameter
            if (!is_object($receiveStructure)) {
                throw new \Exception('Parameter 3 passed to ReadUserSpace must be a ProgramParameter object.');
            }

            $labelForSizeOfInputData = 'dssize';
//
            $params[] = Toolkit::AddParameterSize("Length of data", 'dataLen', $labelForSizeOfInputData);

            // wrap simple ds around receive structure so we can assign a varname to retrieve later.
            $receiveDs[] = $receiveStructure;
            $params[] = Toolkit::AddDataStruct($receiveDs, $receiverVarName, 0, '', false, $labelForSizeOfInputData);

        } else {
            // regular readlen, no special structure or size labels.
            $params[] = Toolkit::AddParameterInt32('in',  "Size of data", 'datasize', $readlen);
            $params[] = Toolkit::AddParameterChar('out', $readlen, $receiverVarName, $receiverVarName, $receiveStructure);
        }

        $params[] = Toolkit::AddErrorDataStruct();

        $retPgmArr = $this->ToolkitSrvObj->PgmCall('QUSRTVUS', 'QSYS', $params);

        if ($this->ToolkitSrvObj->verify_CPFError($retPgmArr , "Read user space failed. Error:"))
            return false;
        $retArr = $retPgmArr['io_param'];

        // return our receiverstructure.
        return $retArr[$receiverVarName];
    }
public function ReadUserSpace ( $ frompos = 1 , $ readlen = 0 , $ receiveStructure = null ) { //how to see via green screen DSPF STMF('/QSYS.lib/qgpl.lib/ZS14371311.usrspc') $ dataRead = ' ' ; $ params [ ] = Toolkit :: AddParameterChar ( 'in' , 20 , "User space name and library" , 'userspacename' , $ this -> getUSFullName ( ) ) ; $ params [ ] = Toolkit :: AddParameterInt32 ( 'in' , "From position" , 'position_from' , $ frompos ) ; $ receiverVarName = 'receiverdata' ; if ( $ receiveStructure ) { // must be a ProgramParameter if ( ! is_object ( $ receiveStructure ) ) { throw new \ Exception ( 'Parameter 3 passed to ReadUserSpace must be a ProgramParameter object.' ) ; } $ labelForSizeOfInputData = 'dssize' ; // $ params [ ] = Toolkit :: AddParameterSize ( "Length of data" , 'dataLen' , $ labelForSizeOfInputData ) ; // wrap simple ds around receive structure so we can assign a varname to retrieve later. $ receiveDs [ ] = $ receiveStructure ; $ params [ ] = Toolkit :: AddDataStruct ( $ receiveDs , $ receiverVarName , 0 , '' , false , $ labelForSizeOfInputData ) ; } else { // regular readlen, no special structure or size labels. $ params [ ] = Toolkit :: AddParameterInt32 ( 'in' , "Size of data" , 'datasize' , $ readlen ) ; $ params [ ] = Toolkit :: AddParameterChar ( 'out' , $ readlen , $ receiverVarName , $ receiverVarName , $ receiveStructure ) ; } $ params [ ] = Toolkit :: AddErrorDataStruct ( ) ; $ retPgmArr = $ this -> ToolkitSrvObj -> PgmCall ( 'QUSRTVUS' , 'QSYS' , $ params ) ; if ( $ this -> ToolkitSrvObj -> verify_CPFError ( $ retPgmArr , "Read user space failed. Error:" ) ) return false ; $ retArr = $ retPgmArr [ 'io_param' ] ; // return our receiverstructure. return $ retArr [ $ receiverVarName ] ; }
if receiveDescription given, readlen = 0

@param int $frompos
@param int $readlen
@param null $receiveStructure
@return bool
@throws \Exception
if receiveDescription given readlen = 0