SAGQENCO
Description
The SAGQENCO function encodes the sqlprecision, sqlscale and sqllength into sqllen of decimal and numeric SQL data type columns.
Any value may be supplied for sqllength, only sqlprecision and sqlscale will be used for the encoding.
Examples
sagqenco (
int sqllen,
int sqlprecision,
int sqlscale,
int sqllength
);

sqllen | Output | SQLVAR->SQLLEN
sqlprecision | Input | SQLPRECISION to be encoded
sqlscale | Input | SQLSCALE to be encoded
sqllength | Input | SQLLENGTH to be encoded (not used)

C/C++
#include <aceapic.h>
sagqenco (&API_OUTPUT_SQLDA->sqlvar[column].sqllen,
&API_SQLPRECISION,
&API_SQLSCALE,
&API_SQLLENGTH);
COBOL
All parameters must be declared as COMP-5.
COPY ACEAPIB.
CALL "SAGQENCO" USING
BY REFERENCE SQLLEN OF SQLVAR OF API-OUTPUT-SQL(column)
BY REFERENCE API_SQLPRECISION
BY REFERENCE API_SQLSCALE
BY REFERENCE API_SQLLENGTH
PL/I
%INCLUDE aceapip ;
CALL sagqenco(
API_OUTPUT_SQLDA_PTR->API_OUTPUT_SQLDA.SQLVAR(column).SQLLEN,
API_SQLPRECISION,
API_SQLSCALE,
API_SQLLENGTH) ;