Previous: Defining data sets
Up: Defining data sets
Next: DSLIKE
Previous Page: Defining data sets
Next Page: DSLIKE

DSDEF

dsdef(name,type,isec,nitem,labels,iv*,ierr*)

int dsdef(name,type,isec,nitem,labels,iv,ierr) char *name; char *type; int isec; int nitem; char *labels; int *iv; int *ierr;

DSDEF defines a data set. The definition is stored permanently and is used when the operation on data set are performed.

NAME
- character - data set name (up to 16 characters).dots and spacess are illegal, names beginning with a dot are considered as internal DSPACK objects
TYPE
- character - data set type:
'I'
integer
'R'
real
'L'
logical
'D'
double precision
'B'
bit string
'C*n'
fixed character - n bytes per item (mod(n,4)=0)
'C'
character - only single entry of any length
'S'
structure

'S' type implies that the data set is defined on a basis of other objects defined already. The 'comment' fields of LABELS array are used to specify names of template objects.

The above type may be followed by 'A' (ie C*24A) - this means that the comment items are present in the LABELS array. If LABELS are passed as a single string 'A' is not necessary.

If the data set is to have items of different types (but no arrays or structures) it may be defined as mixed. In this case TYPE has a form similar to the one used by MZFORM - for instance:

'3I 4R 4H'
- 3 integers, 4 reals and one 16 byte character item
'3D 2R 2L'
- 3 double, 2 reals and 2 (4-byte) logicals
'1I 2H 3H'
- 1 integer, one 8 byte character and one 12 byte character

Separate character items should not be joined together. 'S' and '/' descriptors are forbidden.
ISEC
- section number.
by convention:
1
- event section, short term
2
- constant section - long term
....
0
- no section - used to define templates - objects with ISEC=0 cannot hold data - they may be used to define other objects.

NITEM
- number of items per entry.

LABELS
- character array or character string - item names and additional info.
Two forms are allowed:
character*n LABELS(m)
where n may be anything, but only first 20 characters are significant,m must be at least NITEM except in following cases:
1)
if 'A' is present in TYPE, m must be at least 2*NITEM. The last NITEM elements contain comments - one for each item.
2)
if TYPE='S', m must be at least 2*NITEM. The last NITEM elements contain names of known objects which define items of the data set. Important: First NITEM LABELS must not contain spaces, dots, commas or character '|',

character*m LABELS
In this form dsdef does its own parsing of the string LABELS.
Parsing rules:
  • Elements are separated by spaces or character '|'. Separators must not be mixed - use either spaces or '|' in the whole string.
  • There must be at least NITEM elements.
  • If TYPE='S' there must be at least 2*NITEM elements. 'A' in TYPE is not needed in this case and is ignored.

IV*
- if succesful dsdef returns the data set handle - in principle this handle could be stored by the program and the data set name could be ignored from then on. However in practice it is easier to use a separate handle for each call in each program unit rather than passing handles between units.

IERR*
- dspack error flag - should be 0 when succesful.



Previous: Defining data sets
Up: Defining data sets
Next: DSLIKE
Previous Page: Defining data sets
Next Page: DSLIKE

wwwd@na49
Fri Nov 4 23:36:02 MET 1994