You are here: Development Standards > Routines > Application-SpecificRoutines > PORHTRAN.PUB

# PORHTRAN.PUB

PORHTRAN.PUB is a public program that handles writing records to the Purchase Order receipt history file. This interface is called from routines that need to write new records to PORHx.

(Normal entry point)

This entry point is used when new records are to be written to the PORHx file. If PORH.SEQ$ is set prior to calling PORHTRAN.PUB, the sequence number contained in that variable will always be used when writing a new record. If PORH.SEQ$ is set to ““, a new sequence number will be generated and returned thru PORH.SEQ$

`0099 ENTER PORH,PORH$,OSSECH,OSSE$`

Variable | Description
PORH | Channel PORHx file is opened on
PORH$ | PORHx string template (see the Purchase Order File Layouts)
OSSECH | Channel OSSE file is opened on.
OSSE$ | String template for OSSE file.

Exit Points | Explanation
EXIT | PORHTRAN.PUB normally exits with no error.
EXIT ERR | An error is returned when an error occurs.

RESERVE_PORH_SEQ:

This entry point is used when a sequence number is to be reserved so that it’s not used until needed by the calling program. The sequence number is returned to the calling program thru the SEQ$ variable. The next available number is then written back to the NXTSEQ record in PORHx.

`3010 RESERVE_PORH_SEQ:`
`3015 ENTER PORH,SEQ$,PORH$,OSSECH,OSSE$`

Variable | Description
PORH | Channel PORHx file is opened on
SEQ$ | Next available sequence number in PORHx
PORH$ | PORHx string template (see the Purchase Order File Layouts)
OSSECH | Channel OSSE file is opened on.
OSSE$ | String template for OSSE file.