Last Revised: 01/30/17 |
CDS064 is used to define data files and folders. It is typically only needed for string files, as CDS034 should be used to define all data files, both permanent and temporary, that have been described in the Dynamo Tools Data Dictionary. See CDS002 to erase and re-define an existing data file.
When passed certain characteristics about the file to be defined, the routine will:
- Optionally determine the number of records to be in the file based on the number of records in some other file (not needed anymore now that most files are dynamic).
- Optionally determine an unused name for the file.
- Define the file.
- Open the file.
Note that files defined in a tmp
directory (including /tmp/
,
./tmp/
, and tmp/
) will be erased upon return to
the menu. This is done so that temporary work files do not need to be erased by
the application program. You can disable the option to delete files
defined in tmp upon return to the menu by adding a "p"
to the front
of the TYPE$
field. If you have other "temporary" files that you do not
want automatically erased, then define them in the TEMP/
directory.
We also typically run the cleartmp routine using
cron that deletes files in tmp/
each night that are more than one
day old.
Calling Format:
CALL "CDS064", ERR=NNNN, Y$,
CHAN, DISCNO,
KEYSIZE, RECS, RECSIZE,
TYPE$, FILNAM$,
DISPMSG$,
AUXFIL
$
CDS064 | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
NNNN
|
the line label/number to branch to if unable to define file.
|
|||||||||||||||||||
Y$
|
the standard terminal control variable | |||||||||||||||||||
CHAN
|
the channel number to which the file should be opened. If passed with a value of zero, then CDS064 will call CDS088 to obtain an available channel and return that channel number to the calling program. | |||||||||||||||||||
DISCNO
|
Disc Number - obsolete, was used on Basic Four computers where disc drives were referred to by number and fileset. | |||||||||||||||||||
KEYSIZE
|
Number of characters in key for files of type SKY, DIR, and SRT. | |||||||||||||||||||
RECS
|
Number of records in file. Normally passed as zero to create file without limit. | |||||||||||||||||||
RECSIZE
|
Characters per record. Applies to files of type MKY, SKY, DIR, and IND. | |||||||||||||||||||
TYPE$
|
The type of file to be defined. There are three components to
TYPE$ . Note that all files defined by CDS064 are in the
'highly recoverable' format.
|
|||||||||||||||||||
FILNAM$
|
The name of the file to be defined. FILNAM$ can
optionally include a data server prefix, a drive letter followed by a colon, folder, base file name, and extension. FILNAM$ will be returned to the calling program with the actual file
name defined. Leading and trailing blanks are removed from FILNAM$ . Note that any of the following characters in FILNAM$ : blank, <, >, |, *, ? and non-printable characters are
replaced with a hyphen.
|
|||||||||||||||||||
DISPMSG$
|
This parameter is obsolete and is not used. On older systems where it took the system from several seconds to several minutes to define and initialize a large data file, this field was used to override the standard display message while the file was being defined. | |||||||||||||||||||
AUXFIL$
|
This parameter is not needed much anymore with the advent of dynamic
files. AUXFIL$ is used when you want the define the file
FILNAM$ based
on the number of records that are in use in file AUXFIL$ . When
AUXFIL$
is used, the number of records defined in the new file will be the number of
records in use in the AUXFIL$ file, plus a percentage specified in
RECS .
For example, to define a file with 10% more records than are in use in AUXFIL$ , pass
RECS as 10. |
Examples
- Define a single-keyed MKEYED file with a keysize of 14, with 180 records, and 64 bytes
per record, using the file name DSFD32, and open the file to device
7.
CALL "CDS064",Y$,7,0,14,180,64,"SKY","DSFD32"
- Create the same file as above but instead of 180 records, define the file
with the same number of records that are in file DSFD10.
CALL "CDS064",Y$,7,0,14,0,64,"SKY","DSFD32","","DSFD10"
- The previous example would define file DSFD32 to have the number of active
records in file DSFD10 (assuming DSFD10 is a keyed file). This means that if
file DSFD10 is defined to have 1000 records, but only 650 are currently in
use, then file DSFD32 will be defined as only 650 records. To create a file
with 10% more than the number of defined records pass the RECS parameter
the percentage.
CALL "CDS064",Y$,7,0,14,10,64,"SKY","DSFD32","","DSFD10"
- Define a Sort file, which will be used to sort a customer file, DSUD10
which requires a key size of 12. The number of records should be the same as
the number of active records in the customer file. Let CDS064 determine
the channel number and file name.
CALL "CDS064",Y$,WRK,0,12,0,0,"SRT",WRKFIL$,"","DSUD10"
- Define a string file named TEST in the WORK directory.
CALL "CDS064",Y$,CHAN,0,0,0,0,"STR","WORK/TEST"
- Define a string file named TEST in the tmp directory. File will be
erased upon return to menu.
CALL "CDS064",Y$,CHAN,0,0,0,0,"STR","tmp/TEST"
- Define a string file named TEST in the tmp directory. File will
not be erased upon return to menu.
CALL "CDS064",Y$,CHAN,0,0,0,0,"pSTR","tmp/TEST"
- Define a large Single Keyed file.
CALL "CDS064",Y$,CHAN,0,4,0,128,"LSKY","DS/DSQA01"
Examples of FILNAM$ |
|
---|---|
Passed to CDS064 | Example of returned Value |
""
|
./tmp/DS-SO480 /u/CDI/tmp/DS-SO480 /<server,port=1100>/u/CDI/tmp/DS-SO480 |
",txt"
|
./tmp/DS-SO480-123.txt |
",html"
|
./tmp/DS/SO480-123.htm |
"DSSO40"
|
DS/DSSO40 |
"DSU010" with TYPE$="PGM" |
DS/PGM/DSU010 |
"DS/DSSO40"
|
DS/DSSO40 |
"TEMP/,txt"
|
TEMP/DS-SO480-123.txt |
"TEST."
|
./tmp/TEST-123 |
"PRT/"
|
PRT/DS-SO480 |
"PRT/."
|
PRT/DS-SO480-123 |
"PRT/.txt"
|
PRT/DS-SO480.txt |
"DY/SO480"
|
DY/SO480 |