You are here: Development Standards > Routines > General Routines > GENCVTTP.PUB

# GENCVTTP.PUB

GENCVTTP.PUB is a public program that performs several functions. It’s key function is to convert data files using previous and current template information.

(No Entry Label)

This entry point is the main entry point for accessing this public routine.

`0050 PRINT_FORM:`
`0060 ENTER FILE[ALL],COPY$,TEMPLATEOLD$,TEMPLATENEW$,DEFAULT$,PAD$,ALIGNMENT$,MSG$,OSGUI$`

Variable | Description
FILE[ALL] | Standard file array
COPY$ | Template with conversion information
TEMPLATEOLD$ | Dimensioned to old file template being converted
TEMPLATENEW$ | Dimensioned to new file template being converted
DEFAULT$ | Dimensioned to new file template being converted. Individual fields can be set to defaults values and destination file will contain those defaults
PAD$ | Dimensioned to new file template being converted. Individual fields can be set with a pad character to pad the destination field with the character. Leaving this blank sets default pad character to " "
ALIGNMENT$ | Dimensioned to new file template being converted. Individual fields can be set to force a padding method with the PAD character from the PAD template. "Z" = Zero padded (ignores PAD character) "L" = Left padded using PAD character "R" = Right padded using PAD character
MSG$ | Returns error messages
OSGUI$ | Standard GUI template

Exit Points | Explanation
EXIT | GENCVTTP.PUB normally exits with no error.
EXIT ERR | GENCVTTP.PUB returns untrapped errors if one occurs.

Normal errors will be handled thru ERRORTRAP function, which like most application converion programs, will temporarily hault the conversion process if the user desires so they can break to console mode and attempt to debug the source of the error.

The COPY$ template has the following format:

Field | Description
FILE1NAME:C(12*) | Source file records are read from
FILE2NAME:C(12*) | Destination file records are written to
CHAN1:N(2*) | Channel number source file is opened on. If set to 0, COPY.FILE1NAME$ will be opened via TASK=7 thru GENOPEN.PUB.
CHAN2:N(2*) | Channel number source file is opened on. If set to 0, COPY.FILE2NAME$ will be opened via TASK=7 thru GENOPEN.PUB.
SPECIAL:C(50*) | Program name called on every record read
LOGCH:N(2*) | Channel that error log is opened on
WARN:C(1*) | "Y" or "N" based on users response on warning if any errors occur during conversion
O9:C(504*) | Set to O9$ is doing any date conversion with GENDATE.PUB
PPY:N(2*) | Set to number of periods per year
EXTRASTR[5]:C(50*) | Array of extra strings carried thru to called program found in CALL.SPECIAL$
EXTRANUM[5]:N(2*) | Array of extra numerics carried thru to called program found in CALL.SPECIAL$

INITIALIZE_TEMPLATE:

This entry point is to retrieve the template format that will be set up and used for general form information, as well as the temporary files built for use for printing checks.

`4305 INITIALIZE_TEMPLATE:`
`4310 ENTER COPY$`

Variable | Description
COPY$ | Standard conversion template

See the Accounts Payable file layouts for APCFHxxx and APCFDxxx for layouts of the temporary files and their templates.