Function SET175 Generate Static Pages
********** COMMENT(=======================================================);
********** COMMENT(Process ........: SET_175);
********** COMMENT(Function .......: SET175);
********** COMMENT(Created on .....: 18/05/00 at 14:43:32);
********** COMMENT(Description ....: Shipping - Generate all static pages);
********** COMMENT(Version.........: 1);
********** COMMENT();
********** COMMENT(Full Description: The purpose of this function is to);
********** COMMENT(assign unique page numbers and then to submit the);
********** COMMENT(functions that will generate each page.);
********** COMMENT();
********** COMMENT(Disclaimer: The following material is supplied as an);
********** COMMENT(example only. No warranty is expressed or implied.);
********** COMMENT();
********** COMMENT(=======================================================);
********** COMMENT(Function control options);
FUNCTION OPTIONS(*DIRECT);
********** COMMENT();
********** COMMENT(<RDML ONCONDITION> field.);
********** COMMENT(Group and field definitions);
DEFINE FIELD(#S_175POS) TYPE(*DEC) LENGTH(003) DECIMALS(0) DESC('Character position in string');
********** COMMENT();
********** COMMENT();
********** COMMENT(Mainline);
********** COMMENT();
REQUEST FIELDS((#S_IFSPATH)(#S_HOSTPRT)(#S_HOSTURL)) DESIGN(*DOWN) IDENTIFY(*DESC);
BEGINCHECK;
********** COMMENT(Reject IFS Path if it contains quotes);
USE BUILTIN(SCANSTRING) WITH_ARGS(#S_IFSPATH #QUOTE) TO_GET(#S_175POS);
IF COND('#S_175POS *GT 0');
SET_ERROR FOR_FIELD(#S_IFSPATH) MSGTXT('The IFS Path must not include quotes');
ENDIF;
ENDCHECK;
********** COMMENT(Check for changes in #S_IFSPATH #S_HOSTPRT #S_HOSTURL);
EXECUTE SUBROUTINE(CHK_SYSVAR);
********** COMMENT();
********** COMMENT(Generate the front page);
SUBMIT PROCESS(SET_175) FUNCTION(SET175B);
********** COMMENT();
********** COMMENT(Generate the Eastbound Schedule);
CHANGE FIELD(#S_175PAG) TO('''S_175EBND''');
CHANGE FIELD(#S_175SRV) TO('''EASTBOUND''');
EXCHANGE FIELDS(#S_175PAG #S_175SRV);
SUBMIT PROCESS(SET_175) FUNCTION(SET175C);
********** COMMENT();
********** COMMENT(Generate the Westbound Schedule);
CHANGE FIELD(#S_175PAG) TO('''S_175WBND''');
CHANGE FIELD(#S_175SRV) TO('''WESTBOUND''');
EXCHANGE FIELDS(#S_175PAG #S_175SRV);
SUBMIT PROCESS(SET_175) FUNCTION(SET175C);
********** COMMENT();
********** COMMENT(Assign unique identifying pages to all ports &);
********** COMMENT(port pairs);
DEFINE FIELD(#S_175IDN) TYPE(*DEC) LENGTH(005) DECIMALS(0);
CHANGE FIELD(#S_175IDN) TO(0);
SELECT FIELDS(#S_175PRT) FROM_FILE(SETPT1);
CHANGE FIELD(#S_175IDN) TO('#S_175IDN + 1');
EXECUTE SUBROUTINE(URL) WITH_PARMS(#S_175IDN #S_175IDP1);
UPDATE FIELDS(#S_175IDP1) IN_FILE(SETPT1);
ENDSELECT;
********** COMMENT();
SELECT FIELDS(#S_175PRT1) FROM_FILE(SETPTP);
CHANGE FIELD(#S_175IDN) TO('#S_175IDN + 1');
EXECUTE SUBROUTINE(URL) WITH_PARMS(#S_175IDN #S_175IDPP);
UPDATE FIELDS(#S_175IDPP) IN_FILE(SETPTP);
ENDSELECT;
********** COMMENT(Generate the first ports page for each service);
********** COMMENT(Eastbound);
CHANGE FIELD(#S_175PAG) TO('''S_175EBPP''');
CHANGE FIELD(#S_175SRV) TO('''EASTBOUND''');
EXCHANGE FIELDS(#S_175PAG #S_175SRV);
SUBMIT PROCESS(SET_175) FUNCTION(SET175D);
********** COMMENT(Westbound);
CHANGE FIELD(#S_175PAG) TO('''S_175WBPP''');
CHANGE FIELD(#S_175SRV) TO('''WESTBOUND''');
EXCHANGE FIELDS(#S_175PAG #S_175SRV);
SUBMIT PROCESS(SET_175) FUNCTION(SET175D);
********** COMMENT(Generate each first port page);
********** COMMENT((One page per first port. Each page contains a link);
********** COMMENT(for every possible second port));
SELECT FIELDS((#S_175SRV)(#S_175PRT)(#S_175IDP1)(#S_175LD)) FROM_FILE(SETPT1L1) WHERE('#S_175LD *EQ Y');
EXCHANGE FIELDS(#S_175SRV #S_175PRT #S_175IDP1);
SUBMIT PROCESS(SET_175) FUNCTION(SET175E);
********** COMMENT(Generate Port Pair Schedules);
********** COMMENT((One page per valid port pair with the schedule for);
********** COMMENT(that port pair));
SELECT FIELDS((#S_175SRV)(#S_175PRT1)(#S_175PRT2)(#S_175IDPP)) FROM_FILE(SETPTP) WITH_KEY(#S_175SRV #S_175PRT);
EXCHANGE FIELDS(#S_175SRV #S_175PRT1 #S_175PRT2 #S_175IDPP);
SUBMIT PROCESS(SET_175) FUNCTION(SET175F);
ENDSELECT;
ENDSELECT;
********** COMMENT();
SUBROUTINE NAME(URL) PARMS((#S_175IDN) (#S_175IDP1));
CHANGE FIELD(#S_175IDP1) TO(*NULL);
SUBSTRING FIELD(#S_175IDN 1) INTO_FIELD(#S_175IDP1 1);
USE BUILTIN(TCONCAT) WITH_ARGS('S_175' #S_175IDP1) TO_GET(#S_175IDP1);
ENDROUTINE;
********** COMMENT();
SUBROUTINE NAME(CHK_SYSVAR);
********** COMMENT();
DEF_LIST NAME(#PARM_NAME) FIELDS(#S_SVNAME) TYPE(*WORKING);
DEF_LIST NAME(#PARM_VALU) FIELDS(#S_SVCHVAL) TYPE(*WORKING);
CLR_LIST NAMED(#PARM_VALU);
CLR_LIST NAMED(#PARM_NAME);
********** COMMENT();
********** COMMENT(Update system variables if changed);
IF COND('#S_IFSPATH *ne *S_IFSPATH');
CHANGE FIELD(#S_SVNAME) TO('''*S_IFSPATH''');
CHANGE FIELD(#S_SVCHVAL) TO(#S_IFSPATH);
ADD_ENTRY TO_LIST(#PARM_VALU);
ADD_ENTRY TO_LIST(#PARM_NAME);
ENDIF;
********** COMMENT();
IF COND('#s_hosturl *ne *s_hosturl');
CHANGE FIELD(#S_SVNAME) TO('''*S_HOSTURL''');
CHANGE FIELD(#S_SVCHVAL) TO(#S_HOSTURL);
ADD_ENTRY TO_LIST(#PARM_VALU);
ADD_ENTRY TO_LIST(#PARM_NAME);
ENDIF;
********** COMMENT();
IF COND('#s_hostprt *ne *s_hostport');
CHANGE FIELD(#S_SVNAME) TO('''*S_HOSTPORT''');
CHANGE FIELD(#S_SVCHVAL) TO(#S_HOSTPRT);
ADD_ENTRY TO_LIST(#PARM_VALU);
ADD_ENTRY TO_LIST(#PARM_NAME);
ENDIF;
********** COMMENT();
IF COND('(#s_hostprt *ne *s_hostport) or (#s_hosturl *ne *s_hosturl) or (#S_IFSPATH *ne *s_IFSPATH)');
CALL PROCESS(*DIRECT) FUNCTION(SETCHSV) PASS_LST(#PARM_NAME #PARM_VALU );
ENDIF;
********** COMMENT();
ENDROUTINE;
********** COMMENT(=======================================================);
********** COMMENT(Process ........: SET_175);
********** COMMENT(Function .......: SET175);
********** COMMENT(Created on .....: 18/05/00 at 14:43:32);
********** COMMENT(Description ....: Shipping - Generate all static pages);
********** COMMENT(Version.........: 1);
********** COMMENT();
********** COMMENT(Full Description: The purpose of this function is to);
********** COMMENT(assign unique page numbers and then to submit the);
********** COMMENT(functions that will generate each page.);
********** COMMENT();
********** COMMENT(Disclaimer: The following material is supplied as an);
********** COMMENT(example only. No warranty is expressed or implied.);
********** COMMENT();
********** COMMENT(=======================================================);
********** COMMENT(Function control options);
FUNCTION OPTIONS(*DIRECT);
********** COMMENT();
********** COMMENT(<RDML ONCONDITION> field.);
********** COMMENT(Group and field definitions);
DEFINE FIELD(#S_175POS) TYPE(*DEC) LENGTH(003) DECIMALS(0) DESC('Character position in string');
********** COMMENT();
********** COMMENT();
********** COMMENT(Mainline);
********** COMMENT();
REQUEST FIELDS((#S_IFSPATH)(#S_HOSTPRT)(#S_HOSTURL)) DESIGN(*DOWN) IDENTIFY(*DESC);
BEGINCHECK;
********** COMMENT(Reject IFS Path if it contains quotes);
USE BUILTIN(SCANSTRING) WITH_ARGS(#S_IFSPATH #QUOTE) TO_GET(#S_175POS);
IF COND('#S_175POS *GT 0');
SET_ERROR FOR_FIELD(#S_IFSPATH) MSGTXT('The IFS Path must not include quotes');
ENDIF;
ENDCHECK;
********** COMMENT(Check for changes in #S_IFSPATH #S_HOSTPRT #S_HOSTURL);
EXECUTE SUBROUTINE(CHK_SYSVAR);
********** COMMENT();
********** COMMENT(Generate the front page);
SUBMIT PROCESS(SET_175) FUNCTION(SET175B);
********** COMMENT();
********** COMMENT(Generate the Eastbound Schedule);
CHANGE FIELD(#S_175PAG) TO('''S_175EBND''');
CHANGE FIELD(#S_175SRV) TO('''EASTBOUND''');
EXCHANGE FIELDS(#S_175PAG #S_175SRV);
SUBMIT PROCESS(SET_175) FUNCTION(SET175C);
********** COMMENT();
********** COMMENT(Generate the Westbound Schedule);
CHANGE FIELD(#S_175PAG) TO('''S_175WBND''');
CHANGE FIELD(#S_175SRV) TO('''WESTBOUND''');
EXCHANGE FIELDS(#S_175PAG #S_175SRV);
SUBMIT PROCESS(SET_175) FUNCTION(SET175C);
********** COMMENT();
********** COMMENT(Assign unique identifying pages to all ports &);
********** COMMENT(port pairs);
DEFINE FIELD(#S_175IDN) TYPE(*DEC) LENGTH(005) DECIMALS(0);
CHANGE FIELD(#S_175IDN) TO(0);
SELECT FIELDS(#S_175PRT) FROM_FILE(SETPT1);
CHANGE FIELD(#S_175IDN) TO('#S_175IDN + 1');
EXECUTE SUBROUTINE(URL) WITH_PARMS(#S_175IDN #S_175IDP1);
UPDATE FIELDS(#S_175IDP1) IN_FILE(SETPT1);
ENDSELECT;
********** COMMENT();
SELECT FIELDS(#S_175PRT1) FROM_FILE(SETPTP);
CHANGE FIELD(#S_175IDN) TO('#S_175IDN + 1');
EXECUTE SUBROUTINE(URL) WITH_PARMS(#S_175IDN #S_175IDPP);
UPDATE FIELDS(#S_175IDPP) IN_FILE(SETPTP);
ENDSELECT;
********** COMMENT(Generate the first ports page for each service);
********** COMMENT(Eastbound);
CHANGE FIELD(#S_175PAG) TO('''S_175EBPP''');
CHANGE FIELD(#S_175SRV) TO('''EASTBOUND''');
EXCHANGE FIELDS(#S_175PAG #S_175SRV);
SUBMIT PROCESS(SET_175) FUNCTION(SET175D);
********** COMMENT(Westbound);
CHANGE FIELD(#S_175PAG) TO('''S_175WBPP''');
CHANGE FIELD(#S_175SRV) TO('''WESTBOUND''');
EXCHANGE FIELDS(#S_175PAG #S_175SRV);
SUBMIT PROCESS(SET_175) FUNCTION(SET175D);
********** COMMENT(Generate each first port page);
********** COMMENT((One page per first port. Each page contains a link);
********** COMMENT(for every possible second port));
SELECT FIELDS((#S_175SRV)(#S_175PRT)(#S_175IDP1)(#S_175LD)) FROM_FILE(SETPT1L1) WHERE('#S_175LD *EQ Y');
EXCHANGE FIELDS(#S_175SRV #S_175PRT #S_175IDP1);
SUBMIT PROCESS(SET_175) FUNCTION(SET175E);
********** COMMENT(Generate Port Pair Schedules);
********** COMMENT((One page per valid port pair with the schedule for);
********** COMMENT(that port pair));
SELECT FIELDS((#S_175SRV)(#S_175PRT1)(#S_175PRT2)(#S_175IDPP)) FROM_FILE(SETPTP) WITH_KEY(#S_175SRV #S_175PRT);
EXCHANGE FIELDS(#S_175SRV #S_175PRT1 #S_175PRT2 #S_175IDPP);
SUBMIT PROCESS(SET_175) FUNCTION(SET175F);
ENDSELECT;
ENDSELECT;
********** COMMENT();
SUBROUTINE NAME(URL) PARMS((#S_175IDN) (#S_175IDP1));
CHANGE FIELD(#S_175IDP1) TO(*NULL);
SUBSTRING FIELD(#S_175IDN 1) INTO_FIELD(#S_175IDP1 1);
USE BUILTIN(TCONCAT) WITH_ARGS('S_175' #S_175IDP1) TO_GET(#S_175IDP1);
ENDROUTINE;
********** COMMENT();
SUBROUTINE NAME(CHK_SYSVAR);
********** COMMENT();
DEF_LIST NAME(#PARM_NAME) FIELDS(#S_SVNAME) TYPE(*WORKING);
DEF_LIST NAME(#PARM_VALU) FIELDS(#S_SVCHVAL) TYPE(*WORKING);
CLR_LIST NAMED(#PARM_VALU);
CLR_LIST NAMED(#PARM_NAME);
********** COMMENT();
********** COMMENT(Update system variables if changed);
IF COND('#S_IFSPATH *ne *S_IFSPATH');
CHANGE FIELD(#S_SVNAME) TO('''*S_IFSPATH''');
CHANGE FIELD(#S_SVCHVAL) TO(#S_IFSPATH);
ADD_ENTRY TO_LIST(#PARM_VALU);
ADD_ENTRY TO_LIST(#PARM_NAME);
ENDIF;
********** COMMENT();
IF COND('#s_hosturl *ne *s_hosturl');
CHANGE FIELD(#S_SVNAME) TO('''*S_HOSTURL''');
CHANGE FIELD(#S_SVCHVAL) TO(#S_HOSTURL);
ADD_ENTRY TO_LIST(#PARM_VALU);
ADD_ENTRY TO_LIST(#PARM_NAME);
ENDIF;
********** COMMENT();
IF COND('#s_hostprt *ne *s_hostport');
CHANGE FIELD(#S_SVNAME) TO('''*S_HOSTPORT''');
CHANGE FIELD(#S_SVCHVAL) TO(#S_HOSTPRT);
ADD_ENTRY TO_LIST(#PARM_VALU);
ADD_ENTRY TO_LIST(#PARM_NAME);
ENDIF;
********** COMMENT();
IF COND('(#s_hostprt *ne *s_hostport) or (#s_hosturl *ne *s_hosturl) or (#S_IFSPATH *ne *s_IFSPATH)');
CALL PROCESS(*DIRECT) FUNCTION(SETCHSV) PASS_LST(#PARM_NAME #PARM_VALU );
ENDIF;
********** COMMENT();
ENDROUTINE;