Function SET177A

LANSA

Function SET177A

FUNCTION OPTIONS(*DIRECT);
********** COMMENT();
OVERRIDE FIELD(#S_177EMPN) TO_OVERLAY(#EMPNO 001);
OVERRIDE FIELD(#S_177NAME) TO_OVERLAY(#GIVENAME 001);
OVERRIDE FIELD(#S_177SURN) TO_OVERLAY(#SURNAME 001);
OVERRIDE FIELD(#S_177ADR1) TO_OVERLAY(#ADDRESS1 001);
OVERRIDE FIELD(#S_177ADR2) TO_OVERLAY(#ADDRESS2 001);
OVERRIDE FIELD(#S_177ADR3) TO_OVERLAY(#ADDRESS3 001);
OVERRIDE FIELD(#S_177PHON) TO_OVERLAY(#PHONEHME 001);
********** COMMENT();
DEFINE FIELD(#NO_DAYS) REFFLD(#STD_NUM);
DEF_LIST NAME(#MONTHS) FIELDS((#S_177MNTH)(#STD_COUNT)(#NO_DAYS)) COUNTER(#LISTCOUNT) TYPE(*WORKING);
********** COMMENT();
CLR_LIST NAMED(#MONTHS);
BEGIN_LOOP USING(#STD_COUNT) TO(4);
CASE OF_FIELD(#STD_COUNT);
WHEN VALUE_IS('= 1');
CHANGE FIELD(#S_177MNTH) TO(MARCH);
CHANGE FIELD(#NO_DAYS) TO(31);
WHEN VALUE_IS('= 2');
CHANGE FIELD(#NO_DAYS) TO(30);
CHANGE FIELD(#S_177MNTH) TO(APRIL);
WHEN VALUE_IS('= 3');
CHANGE FIELD(#S_177MNTH) TO(MAY);
CHANGE FIELD(#NO_DAYS) TO(31);
OTHERWISE;
CHANGE FIELD(#NO_DAYS) TO(30);
CHANGE FIELD(#S_177MNTH) TO(JUNE);
ENDCASE;
ADD_ENTRY TO_LIST(#MONTHS);
END_LOOP;
********** COMMENT();
EXECUTE SUBROUTINE(ADD_PROJEC);
EXECUTE SUBROUTINE(ADD_EMPLOY);
********** COMMENT();
SUBROUTINE NAME(ADD_EMPLOY);
********** COMMENT();
CHANGE FIELD(#STD_COUNT) TO(*ZERO);
SELECT FIELDS(*ALL) FROM_FILE(PSLMST) WHERE('#std_count < 10') OPTIONS(*ENDWHERE);
EXECUTE SUBROUTINE(GET_PROJEC);
INSERT FIELDS(*ALL) TO_FILE(SETEMP) VAL_ERROR(*NEXT);
CHANGE FIELD(#STD_COUNT) TO('#std_count + 1');
ENDSELECT;
USE BUILTIN(CLR_MESSAGES);
ENDROUTINE;
********** COMMENT();
SUBROUTINE NAME(GET_PROJEC);
********** COMMENT();
DEF_ARRAY NAME(#PRJ) INDEXES(#II) OF_FIELDS(#S_177PRJ1 #S_177PRJ2 #S_177PRJ3 #S_177PRJ4);
BEGIN_LOOP USING(#II) TO(4);
ENT: CHANGE FIELD(#LISTENTRY) TO('#listentry + 1');
GET_ENTRY NUMBER(#LISTENTRY) FROM_LIST(#PROJECTS);
IF COND('#io$sts *ne OK');
CHANGE FIELD(#LISTENTRY) TO(*ZERO);
GOTO LABEL(ENT);
ENDIF;
CHANGE FIELD(#PRJ#II) TO(#S_177PROJ);
END_LOOP;
********** COMMENT();
ENDROUTINE;
********** COMMENT();
SUBROUTINE NAME(ADD_PROJEC);
********** COMMENT();
DEF_LIST NAME(#PROJECTS) FIELDS(#S_177PROJ) TYPE(*WORKING);
CLR_LIST NAMED(#PROJECTS);
CHANGE FIELD(#S_177PROJ) TO('''System Design''');
ADD_ENTRY TO_LIST(#PROJECTS);
CHANGE FIELD(#S_177PROJ) TO('''Quality Assurance''');
ADD_ENTRY TO_LIST(#PROJECTS);
CHANGE FIELD(#S_177PROJ) TO('''R & D''');
ADD_ENTRY TO_LIST(#PROJECTS);
CHANGE FIELD(#S_177PROJ) TO('''Product Support''');
ADD_ENTRY TO_LIST(#PROJECTS);
CHANGE FIELD(#S_177PROJ) TO('''Consulting''');
ADD_ENTRY TO_LIST(#PROJECTS);
CHANGE FIELD(#S_177PROJ) TO('''Administration''');
ADD_ENTRY TO_LIST(#PROJECTS);
CHANGE FIELD(#S_177PROJ) TO('''Product Shipment''');
ADD_ENTRY TO_LIST(#PROJECTS);
CHANGE FIELD(#S_177PROJ) TO('''Documentation''');
ADD_ENTRY TO_LIST(#PROJECTS);
CHANGE FIELD(#S_177PROJ) TO('''Programming''');
ADD_ENTRY TO_LIST(#PROJECTS);
CHANGE FIELD(#S_177PROJ) TO('''System Testing''');
ADD_ENTRY TO_LIST(#PROJECTS);
CHANGE FIELD(#S_177PROJ) TO('''Product Planning''');
ADD_ENTRY TO_LIST(#PROJECTS);
CHANGE FIELD(#S_177PROJ) TO('''Marketing''');
ADD_ENTRY TO_LIST(#PROJECTS);
CHANGE FIELD(#S_177PROJ) TO('''Product Sales''');
ADD_ENTRY TO_LIST(#PROJECTS);
CHANGE FIELD(#S_177PROJ) TO('''Training''');
ADD_ENTRY TO_LIST(#PROJECTS);
CHANGE FIELD(#S_177PROJ) TO('''R & D''');
ADD_ENTRY TO_LIST(#PROJECTS);
CHANGE FIELD(#S_177PROJ) TO('''Product Support''');
ADD_ENTRY TO_LIST(#PROJECTS);
CHANGE FIELD(#S_177PROJ) TO('''Consulting''');
ADD_ENTRY TO_LIST(#PROJECTS);
CHANGE FIELD(#S_177PROJ) TO('''Administration''');
ADD_ENTRY TO_LIST(#PROJECTS);
CHANGE FIELD(#S_177PROJ) TO('''Product Shipment''');
ADD_ENTRY TO_LIST(#PROJECTS);
CHANGE FIELD(#S_177PROJ) TO('''Documentation''');
ADD_ENTRY TO_LIST(#PROJECTS);
CHANGE FIELD(#S_177PROJ) TO('''Programming''');
ADD_ENTRY TO_LIST(#PROJECTS);
CHANGE FIELD(#S_177PROJ) TO('''System Testing''');
ADD_ENTRY TO_LIST(#PROJECTS);
CHANGE FIELD(#S_177PROJ) TO('''Product Planning''');
ADD_ENTRY TO_LIST(#PROJECTS);
CHANGE FIELD(#S_177PROJ) TO('''Marketing''');
ADD_ENTRY TO_LIST(#PROJECTS);
CHANGE FIELD(#S_177PROJ) TO('''Product Sales''');
ADD_ENTRY TO_LIST(#PROJECTS);
CHANGE FIELD(#S_177PROJ) TO('''Training''');
ADD_ENTRY TO_LIST(#PROJECTS);
CHANGE FIELD(#S_177PROJ) TO('''Quality Assurance''');
ADD_ENTRY TO_LIST(#PROJECTS);
ENDROUTINE;