 |
» |
|
 |
|
 |

Copyright (c) Digital Equipment Corporation 1992. All rights reserved
PRODUCT: VAX PLI OP/SYS: VMS
SOURCE: Digital Customer Support Center
OVERVIEW:
This program will create a new indexed file, INDEXED.DAT, with RMS
characteristics from the specified FDL, INDEXED.FDL, loading the
records from a specified input file, SEQ.DAT.
This article is similar to another article entitled:
Example: DIBOL Using CONV$CONVERT To Create A New File
*** CAUTION ***
This sample program has been tested using VAX PLI, version 3.4 on
VMS, version 5.5. However, we cannot guarantee its
effectiveness because of the possibility of error in transmitting or
implementing it. It is meant to be used as a template for writing
your own program, and it may require modification for use on your
system.
This program uses CONV$PASS_FILE to pass the input, output and fdl
file specifications. CONV$PASS_OPTIONS is used to specify the convert
qualifiers to be used. CONV$CONVERT converts the file and returns
the statistics.
PROGRAM:
$create convert.pli
cvt: proc options(main);
%include conv$pass_files;
%include conv$pass_options;
%include conv$convert;
%include $stsdef;
dcl 1 options_array,
2 options(19) fixed bin(31);
dcl infile char(7) init('SEQ.DAT');
dcl fdl char(11) init('INDEXED.FDL');
dcl outfile char(11) init('INDEXED.DAT');
dcl 1 status_array,
2 num_stats fixed bin(31) init(4),
2 num_files fixed bin(31),
2 num_records fixed bin(31),
2 num_exceptions fixed bin(31),
2 num_valid fixed bin(31);
options(1) = 18; /*number of options*/
options(2) = 1; /*create new file*/
options(3) = 0; /*no share*/
options(4) = 1; /*fast load option*/
options(5) = 0; /*nomerger*/
options(6) = 0; /*noappend*/
options(7) = 1; /*sort*/
options(8) = 2; /*work files*/
options(9) = 0; /*key=0*/
options(10) = 0; /*no pad*/
options(11) = 0; /*pad character*/
options(12) = 0; /*no truncate*/
options(13) = 1; /*exit*/
options(14) = 0; /*no fixed control*/
options(15) = 0; /*no fill buckets*/
options(16) = 0; /*read check*/
options(17) = 0; /*write check*/
options(18) = 1; /*fdl provided*/
options(19) = 0;
/*specify input, output and fdl*/
sts$value = conv$pass_files(infile,outfile,fdl);
if ^sts$success
then signal vaxcondition(sts$value);
/*specify options*/
sts$value = conv$pass_options(ref(options_array));
if ^sts$success
then signal vaxcondition(sts$value);
/*create the file*/
sts$value = conv$convert(ref(status_array));
if ^sts$success
then signal vaxcondition(sts$value);
put skip list('number of statistics: ',num_stats);
put skip list('Number of records: ', num_records);
put skip list('Number of exception records: ', num_exceptions);
put skip list('Number of valid records: ', num_valid);
end cvt;
$create indexed.fdl
IDENT "31-DEC-1991 10:38:37 VAX/VMS ANALYZE/RMS_FILE Utility"
SYSTEM
SOURCE VAX/VMS
FILE
ALLOCATION 15
BEST_TRY_CONTIGUOUS no
BUCKET_SIZE 2
CLUSTER_SIZE 3
CONTIGUOUS no
EXTENSION 0
FILE_MONITORING no
GLOBAL_BUFFER_COUNT 6
NAME "INDEXED.DAT;1"
ORGANIZATION indexed
PROTECTION (system:RWED, owner:RWED, group:RE, world:)
RECORD
BLOCK_SPAN yes
CARRIAGE_CONTROL carriage_return
FORMAT fixed
SIZE 20
AREA 0
ALLOCATION 15
BUCKET_SIZE 2
EXTENSION 0
KEY 0
CHANGES no
DATA_KEY_COMPRESSION no
DATA_RECORD_COMPRESSION yes
DATA_AREA 0
DATA_FILL 100
DUPLICATES no
INDEX_AREA 0
INDEX_COMPRESSION no
INDEX_FILL 100
LEVEL1_INDEX_AREA 0
NAME ""
NULL_KEY no
PROLOG 3
SEG0_LENGTH 5
SEG0_POSITION 0
TYPE string
KEY 1
CHANGES yes
DATA_KEY_COMPRESSION no
DATA_AREA 0
DATA_FILL 100
DUPLICATES no
INDEX_AREA 0
INDEX_COMPRESSION no
INDEX_FILL 100
LEVEL1_INDEX_AREA 0
NAME ""
NULL_KEY no
SEG0_LENGTH 5
SEG0_POSITION 15
TYPE string
$create seq.dat
00001aaaaaaaaaa00011
00002bbbbbbbbbb00009
00003cccccccccc00008
$pli convert.pli
$link convert.obj
$write sys$output "Type $RUN CONVERT to create the indexed file"
$ exit
|
buy online or call 1.800.AT.COMPAQ
|
|