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

# SOTRAN.PUB

SOTRAN.PUB is a public program that will generate, validate, and reserve a transaction number for the SOTHx file. The returned number should be used as the transaction number before writing a new record to the SOTHx file.

`0100 ENTER FILE[ALL],TRAN,HEAD,CT1,CT2,ORDER_NO,R0$,SYST_GEN,Y$`

Variable | Description
FILE[ALL] | Standard file array used for the data file channel number
TRAN | FILE[TRAN] index that the ARTDx file is opened on
CT1 | FILE[CT1] index that the ARCTx file is opened on.
CT2 | FILE[CT2] index that the ARCTx file is opened on. This must be different than CT1
ORDER_NO | Order number passed in if not using system generated order numbers
R0$ | Batch/Transaction number from SOTHx. Should contain batch ID set by the calling program + " " or "00000000". The transaction is returned in the last 8 characters.
SYST_GEN | System generated flag from Sales Order Options(O2$(6,1))
Y$ | Set from GENLOCK.PUB in case of error conditions

Exit Points | Explanation
EXIT | SOTRAN.PUB does not return any errors.