Booksman
Booksman

Reputation: 1623

How to create a zoned as/400 DDS definition

I have a field from a query which is a calculated total per invoice. I need to create a PF including this field, I wanted to give the type as Zoned but it is not allowing. I am thinking to use type S. Would that be correct?

            Data        Field  Buffer    Buffer
 Field      Type       Length  Length  Position
 VALUE01    ZONED       16  2      16        17  

as here: VALUE 12S02

Upvotes: 0

Views: 1334

Answers (2)

lamLam
lamLam

Reputation: 475

Yes it should work:

      A            VALUE         12S02    

You could also create using SQL

CREATE TABLE LIBRARY/TABLE01 ( VALUE NUMERIC(12, 2) NOT NULL DEFAULT 0 )

Anyway, for calculated columns, it is more efficient to use packed (DECIMAL in sql).

Upvotes: 1

James Allman
James Allman

Reputation: 41148

Zoned decimal fields are specified with an S in position 35 of the field definition.

See the DDS documentation about specifying the Data type for physical and logical files (position 35) for more information.

Upvotes: 2

Related Questions