Products   Support   Download   Contact

Logical Name Table Symbol Substitution

return to contents or index

Abstract

XENTIS will substitute values from a special logical name table into reports. This can be extremely valuable for inserting values derived in DCL command procedures.

Q&A:

Question:

I have a report that shows what has been shipped during the prior week. This report needs to determine the correct start and end date regardless of which day the report is run. I have used DCL to calculate the dates but do not know how to pass those dates to XENTIS to substitute in the selection logic section. I do not want to manually alter these dates in my DCL command file every time this report is to run. This report is also run in batch. How is this done?

Answer:

This is a good use for XENTIS Symbol Substitution. First, here is an example of the type of DCL routine you might use to extract dates from the system:

$!
$ TIME_STAMP = F$TIME()
$ SHO SYM TIME_STAMP
$ DAYOFWEEK = F$EDIT(F$CVTIME(,,"WEEKDAY"),"UPCASE") !upcase to match next step.
$ IF DAYOFWEEK .EQS. "MONDAY" THEN GOTO MONDAY...
$MONDAY:
$ ENDDATE = F$CVTIME("-1-00","ABSOLUTE","DATE")
$ STARTDATE= F$CVTIME("-8-00","ABSOLUTE","DATE")
$ SHO SYM STARTDATE
$ SHO SYM ENDDATE
$ DAY = F$EXTRACT(0,2,TIME_STAMP)
$ WRITE SYS$OUTPUT "DAY = ",DAY
$ WRITE SYS$OUTPUT "DAY = ",TIME_STAMP
$ WRITE SYS$OUTPUT "STARTDATE =",STARTDATE
$ WRITE SYS$OUTPUT "ENDDATE =",ENDDATE
$ WRITE SYS$OUTPUT "IT'S MONDAY'S DATE"
$ GOTO END3
$TUESDAY:
$ ENDDATE = F$CVTIME("-2-00","ABSOLUTE","DATE")
$ STARTDATE = F$CVTIME("-9-00","ABSOLUTE","DATE")
$ SHO SYM STARTDATE
$ SHO SYM ENDDATE
$ DAY = F$EXTRACT(0,2,TIME_STAMP)
$ WRITE SYS$OUTPUT "DAY = ",DAY
$ WRITE SYS$OUTPUT "DAY = ",TIME_STAMP
$ WRITE SYS$OUTPUT "STARTDATE =",STARTDATE
$ WRITE SYS$OUTPUT "ENDDATE =",ENDDATE
$ WRITE SYS$OUTPUT "IT'S TUESDAY"
$ GOTO END3...
$END3:

To create your symbol substitution table, type the following commands, or include them in your DCL com file.

Note: You MUST have the setup file parameter AMBIG-SYMBOLS set to Y.

$!
$!********* XENTIS Symbol Substitution Info *************
$!
$ CREATE/NAME_TABLE XEN$SYMBOLS !create table called XEN$SYMBOLS
$ DEFINE/TABLE=XEN$SYMBOLS START 'STARTDATE' !define startdate value as Start.
$ DEFINE/TABLE=XEN$SYMBOLS FINISH 'ENDDATE' !define enddate value as Finish.
$!
$! Note single quotes around the symbols you wish to substitute into the XCF.
$!
$!***** IT IS CRITICAL TO HAVE AMBIG-SYMBOLS SET TO Y ***** SEE XCF
$!
$ RUN XENTIS44$PROGRAM:XRP44@DKA100:[USER]SHIPPED/SHOW ! XCF to be executed

XENTIS will now substitute the value of START and FINISH into the .XCF. Look at the following extract from the .XCF:

! ******* XENTIS/REPORT Command File *******
:::
SET AMBIG-SYMBOLS Y
REPORT ! XENTIS function
! ******* File Definition section ******
:::
! ****** Selection Logic Section *******
Y ! Yes we have selection logic
A ! Type of selection logic
A:MAINT GE START ! Selection expression 1
A:MAINT LE FINISH ! Selection expression 2
NONE ! No more selection logic

© 2020 GrayMatter Software Corporation