Previous Topic: ADD StatementNext Topic: ASSIGN REPORT Statement


ASSIGN DATAVIEW Statement (CA Datacom/DB Native Access)

Use the ASSIGN DATAVIEW statement during execution of a single program to associate a CA Datacom/DB native access dataview with a database ID different from the DBID specified when the dataview was cataloged to CA Ideal, or to access a subset of a partitioned table. DBID or TABLE assignments established through this statement do not apply to other programs executed in the same run‑unit. The ASSIGN DATAVIEW statement remains in effect for the program where it was issued throughout the run‑unit until a subsequent ASSIGN DATAVIEW statement is executed in the same program for the same dataview.

This statement has the following format:

ASSIGN DATAVIEW name [ DBID dbid | TABLE tbl ]
name

Specifies the name of the dataview to associate with the database. You cannot use the abbreviation of DATAVIEW (DVW) in this statement.

dbid

A numeric literal or the identifier of a numeric or alphanumeric field that identifies the database with which the dataview is associated. The value must consist of three digits or three characters.

tbl

The three-character identifier of the child partition, or ANY set, for the partitioned table.

ASSIGN DATAVIEW remains in effect only for the duration of the program execution or until a different ASSIGN is made for the dataview. A dataview that a program uses is reassigned for a CA Ideal session if you issued an ASSIGN DATAVIEW command; however, the ASSIGN DATAVIEW statement overrides the ASSIGN DATAVIEW command.

You cannot issue an ASSIGN DATAVIEW statement in a FOR construct for that dataview.

An ASSIGN DATAVIEW statement applies only to the program that contains the statement, not to any calling or called programs associated with that program.

Example

LOOP VARYING I FROM 1 THRU 10
     ASSIGN DATAVIEW CLIENT DBID DBID_TABLE(I)
     FOR EACH CLIENT
         WHERE . . .
     .
     .
     .
     ENDFOR
ENDLOOP