Function SET191E

LANSA

Function SET191E

********** COMMENT(=======================================================);
********** COMMENT(Process ........: SET_191);
********** COMMENT(Function .......: SET191E);
********** COMMENT(Created on .....: 10/10/00 at 14:43:32);
********** COMMENT(Description ....: OV_FILE_SERVICE SET_FILE);
********** COMMENT(Version.........: 1);
**********;
********** COMMENT(This function requests a file name and whether the file);
********** COMMENT( should be set to read only status or normal);
********** COMMENT((read/write) status);
**********;
********** COMMENT(Disclaimer: The following material is supplied as an);
********** COMMENT(example only. No warranty is expressed or implied.);
**********;
********** COMMENT(Receives: nothing);
**********;
********** COMMENT(=======================================================);
********** COMMENT(Function control options);
FUNCTION OPTIONS(*DIRECT);
DEFINE FIELD(#OV_FILE) TYPE(*CHAR) LENGTH(70);
DEFINE FIELD(#OV_READ) TYPE(*CHAR) LENGTH(1) LABEL('Read Only') INPUT_ATR(RB01) DEFAULT(1);
DEFINE FIELD(#OV_NORM) TYPE(*CHAR) LENGTH(1) LABEL('Normal') INPUT_ATR(RB01) DEFAULT(0);
DEFINE FIELD(#OV_RETC) TYPE(*CHAR) LENGTH(2);
********** COMMENT();
********** COMMENT(Mainline);
********** COMMENT();
DEF_COND NAME(*AS400) COND('*CPUTYPE = AS400');
IF COND(*AS400);
MESSAGE MSGTXT('Not available on iSeries');
MENU;
ELSE;
**********;
BEGIN_LOOP;
MESSAGE MSGTXT('Specify name of file whose attribute is to be changed and select attribute');
REQUEST FIELDS((#OV_FILE *L3 *P2 *NOID) (#OV_READ *L5 *P3) (#OV_NORM *L7 *P3));
IF COND('#ov_read = ''1''');
USE BUILTIN(OV_FILE_SERVICE) WITH_ARGS(SET_FILE #OV_FILE READ_ONLY) TO_GET(#OV_RETC);
ELSE;
USE BUILTIN(OV_FILE_SERVICE) WITH_ARGS(SET_FILE #OV_FILE NORMAL) TO_GET(#OV_RETC);
ENDIF;
IF COND('#OV_RETC = OK');
MESSAGE MSGTXT('File attribute successfully changed');
ELSE;
MESSAGE MSGTXT('ERROR : File attribute was NOT changed');
ENDIF;
END_LOOP;
ENDIF;