SUBROUTINE RUN_STATUS_CONV(ConvType, DataIo, SubrLabel, ReturnedValue)

$INSERT LOGICAL

EQU VALID$         to 0    ;* successful
EQU INVALID_MSG$   to 1    ;* bad data       -   print error message window
EQU INVALID_CONV$  to 2    ;* bad conversion -          "         "
EQU INVALID_NOMSG$ to 3    ;* bad but do not print the error message window

Status() = Valid$
BEGIN CASE
   CASE ConvType = 'ICONV'
       
       	Vals = XLATE('SYSREPOSPOPUPS','LSL2**RUN_STATUS',8,'X')
   		Desc = ''
   		LOOP
   			Val = Vals[1,@VM]
   			Code = Val[1,@SVM]
   			Desc = Val[COL2()+1,@SVM]
   		UNTIL Desc = DataIO OR Vals = ''
   			Vals = DELETE(Vals,1,1,0)
   		REPEAT
   		ReturnedValue = Code
       
       
        
   CASE ConvType = 'OCONV'
   		Vals = XLATE('SYSREPOSPOPUPS','LSL2**RUN_STATUS',8,'X')
   		Desc = ''
   		LOOP
   			Val = Vals[1,@VM]
   			Code = Val[1,@SVM]
   			Desc = Val[COL2()+1,@SVM]
   		UNTIL Code = DataIO OR Vals = ''
   			Vals = DELETE(Vals,1,1,0)
   		REPEAT
   		IF Desc = '' THEN Desc = DataIO
   		
   		ReturnedValue = Desc
   		
   CASE OTHERWISE$
        Status() = invalid_msg$
        
END CASE
RETURN
