Cwid. DORIC 9.65, INFO-Text software
إعلان
إعلان
CWID
CWID
datafile_name
Change Width Command expands or reduces the internal and output widths of a data item in a datafile. Some redefined items are appropriately amended. The data file is reformatted to correspond to the new definition.
argument datafile_name discussion
This command allows the user to alter the widths of data items or delete data items completely. The data file is automatically reformatted to the new layout. When increasing the width of an item, the field is padded with blanks on the right for character items and on the left for numeric items. When decreasing the widths, character items are truncated on the right and numeric items on the left. No check is carried out for loss of data. No check is performed on the validity of the new item width.
The command cannot be used directly to insert a new item. However the effect can be achieved as follows:
1) Increase the size of an existing item by the width of the item you want to insert.
2) SAVE TEMP INIT
3) PURGE
4) Use MOD to insert the new item and return the widened item to its original width. Don't forget that the inserted item must come after a widened character item or before a widened numeric item.
5) GET TEMP COPY
An item may be removed completely by reducing by an amount equal to the item width.
INFO Reference Manual Commands 125
CWID example
ENTER COMMAND >SEL PERSONNEL
4 RECORD(S) SELECTED
ENTER COMMAND >IT
DATAFILE NAME: PERSONNEL 1/2/1993
4 ITEMS: STARTING IN POSITION 1
COL ITEM NAME
1 NAME
WDTH OPUT TYP N.DEC PROT
20 20 C — 4
KEY
—
21
31
39
SALARY 10
BIRTH-DATE 8
PHONE-NO 12
10
10
12
N 2
D —
C —
4
4
4
—
—
—
21
31
39
**
DOLLARS
YEAR
AREA-CODE
REDEFINED ITEMS **
7 7 I —
4
3
4
3
I
C
—
—
0
0
0
—
—
—
ENTER COMMAND >CWID PERSONNEL
Enter Name of Item to be Expanded or Reduced >NAME
Enter No. of Columns to Expand or Reduce >10
NOW REFORMATTING DATA IN DATAFILE ***
ENTER COMMAND >IT
DATAFILE NAME: PERSONNEL 1/2/1993
4 ITEMS: STARTING IN POSITION 1
COL ITEM NAME
1 NAME
31 SALARY
41
49
WDTH OPUT TYP DEC PROT KEY OCCRS INDX
30
10
BIRTH-DATE 8
PHONE-NO 12
30
10
10
12
C
N
D
C
—
2
—
—
4
4
4
4
— —
— —
—
—
—
—
—
—
—
—
31
41
49
REDEFINED ITEMS **
DOLLARS 7 7
YEAR 4 4
AREA-CODE 3 3
I
I
C
—
—
—
0
0
0
—
—
—
—
—
—
—
—
—
OCCRS INDX
— —
—
—
—
—
—
—
—
—
—
—
—
—
126 Commands INFO Reference Manual
restrictions see also
CWID
REDEFINED data items that begin or end in the middle of an expanded or reduced data item will not have their starting columns or their internal and output widths changed. REDEFINED data items that completely encompass an expanded or reduced data item will be handled completely.
Cannot be used on gotten or ISAM files.
MODIFY
MRED
INFO Reference Manual Commands 127
تنزيل
إعلان