Archives of the TeradataForum
Message Posted: Sun, 23 Apr 2006 @ 18:50:47 GMT
Subj: | | Re: Creating copybook corresponding to Teradata Field layout |
|
From: | | Anomy Anom |
<-- Anonymously Posted: Sunday, April 23, 2006 11:28 -->
This isn't a Teradata question but a COBOL question.
If the target PICture clause does not contain a sign but the source does (and all SQL numeric fields are signed) then COBOL implicitly invokes
"absolute value" function. So always include S for COMP-anything fields. But if your fields are NULLable that may not avoid "data exception"
problems - you need to use the NULL indicator flags as well.
If this is mainframe, storage match to SQL INTEGER is S9(9) COMP and SMALLINT is S9(4) COMP. But note that values in such a field may actually
be larger (e.g. +65535 to -65536 for SMALLINT) so depending on TRUNC compile option you may need to use S9(10) and S9(5) respectively to avoid
problems.
|