Function SET175Y Generate Port Pairs Data from Port Data
********** COMMENT(=======================================================);
********** COMMENT(Process ........: SET_175);
********** COMMENT(Function .......: SET175Y);
********** COMMENT(Created on .....: 18/05/00 at 14:43:32);
********** COMMENT(Description ....: Generate Port Pairs data from Port);
********** COMMENT( data);
********** COMMENT(Version.........: 1);
********** COMMENT();
********** COMMENT(Full Description: The purpose of this function is to);
********** COMMENT(generate the port pairs data from the port data for);
********** COMMENT(the eastbound and westbound services. It should not);
********** COMMENT(need to be run unless ports have been added or changed.);
********** COMMENT();
********** COMMENT(Disclaimer: The following material is supplied as an);
********** COMMENT(example only. No warranty is expressed or implied.);
********** COMMENT();
DEFINE FIELD(#S_175SEQW) REFFLD(#S_175SEQ);
DEF_LIST NAME(#S_LSTPORT) FIELDS((#S_175PRT1)(#S_175SEQW)) TYPE(*WORKING);
********** COMMENT();
********** COMMENT();
CHANGE FIELD(#S_175SRV) TO('''EASTBOUND''');
EXECUTE SUBROUTINE(PORTPAIRS) WITH_PARMS(#S_175SRV);
CHANGE FIELD(#S_175SRV) TO('''WESTBOUND''');
EXECUTE SUBROUTINE(PORTPAIRS) WITH_PARMS(#S_175SRV);
********** COMMENT();
********** COMMENT();
SUBROUTINE NAME(PORTPAIRS) PARMS((#S_175SRV));
********** COMMENT(build a list of valid load ports);
CLR_LIST NAMED(#S_LSTPORT);
SELECT FIELDS((#S_175PRT)(#S_175LD)(#S_175SEQ)) FROM_FILE(SETPT1) WHERE('#S_175LD *EQ Y') WITH_KEY(#S_175SRV);
CHANGE FIELD(#S_175PRT1) TO(#S_175PRT);
CHANGE FIELD(#S_175SEQW) TO(#S_175SEQ);
ADD_ENTRY TO_LIST(#S_LSTPORT);
ENDSELECT;
********** COMMENT(Get all subsequent ports);
SELECTLIST NAMED(#S_LSTPORT);
SELECT FIELDS((#S_175PRT)(#S_175SEQ)) FROM_FILE(SETPT1) WHERE('#S_175SEQ *GT #S_175SEQW') WITH_KEY(#S_175SRV);
CHANGE FIELD(#S_175PRT2) TO(#S_175PRT);
CHECK_FOR IN_FILE(SETPTP) WITH_KEY(#S_175SRV #S_175PRT1 #S_175PRT2);
IF_STATUS IS(*EQUALKEY);
ELSE;
INSERT FIELDS((#S_175SRV)(#S_175PRT1)(#S_175PRT2)) TO_FILE(SETPTP);
ENDIF;
ENDSELECT;
ENDSELECT;
ENDROUTINE;
********** COMMENT(=======================================================);
********** COMMENT(Process ........: SET_175);
********** COMMENT(Function .......: SET175Y);
********** COMMENT(Created on .....: 18/05/00 at 14:43:32);
********** COMMENT(Description ....: Generate Port Pairs data from Port);
********** COMMENT( data);
********** COMMENT(Version.........: 1);
********** COMMENT();
********** COMMENT(Full Description: The purpose of this function is to);
********** COMMENT(generate the port pairs data from the port data for);
********** COMMENT(the eastbound and westbound services. It should not);
********** COMMENT(need to be run unless ports have been added or changed.);
********** COMMENT();
********** COMMENT(Disclaimer: The following material is supplied as an);
********** COMMENT(example only. No warranty is expressed or implied.);
********** COMMENT();
DEFINE FIELD(#S_175SEQW) REFFLD(#S_175SEQ);
DEF_LIST NAME(#S_LSTPORT) FIELDS((#S_175PRT1)(#S_175SEQW)) TYPE(*WORKING);
********** COMMENT();
********** COMMENT();
CHANGE FIELD(#S_175SRV) TO('''EASTBOUND''');
EXECUTE SUBROUTINE(PORTPAIRS) WITH_PARMS(#S_175SRV);
CHANGE FIELD(#S_175SRV) TO('''WESTBOUND''');
EXECUTE SUBROUTINE(PORTPAIRS) WITH_PARMS(#S_175SRV);
********** COMMENT();
********** COMMENT();
SUBROUTINE NAME(PORTPAIRS) PARMS((#S_175SRV));
********** COMMENT(build a list of valid load ports);
CLR_LIST NAMED(#S_LSTPORT);
SELECT FIELDS((#S_175PRT)(#S_175LD)(#S_175SEQ)) FROM_FILE(SETPT1) WHERE('#S_175LD *EQ Y') WITH_KEY(#S_175SRV);
CHANGE FIELD(#S_175PRT1) TO(#S_175PRT);
CHANGE FIELD(#S_175SEQW) TO(#S_175SEQ);
ADD_ENTRY TO_LIST(#S_LSTPORT);
ENDSELECT;
********** COMMENT(Get all subsequent ports);
SELECTLIST NAMED(#S_LSTPORT);
SELECT FIELDS((#S_175PRT)(#S_175SEQ)) FROM_FILE(SETPT1) WHERE('#S_175SEQ *GT #S_175SEQW') WITH_KEY(#S_175SRV);
CHANGE FIELD(#S_175PRT2) TO(#S_175PRT);
CHECK_FOR IN_FILE(SETPTP) WITH_KEY(#S_175SRV #S_175PRT1 #S_175PRT2);
IF_STATUS IS(*EQUALKEY);
ELSE;
INSERT FIELDS((#S_175SRV)(#S_175PRT1)(#S_175PRT2)) TO_FILE(SETPTP);
ENDIF;
ENDSELECT;
ENDSELECT;
ENDROUTINE;