|
PQL Procedures | DBASE Save File |
DBASE SAVE FILE
procedure creates a file that can be used
to transfer data to a software package that recognises
DBASE
® format.
DBASE SAVE FILE FILENAME = filename [ VARIABLES = { varname [('header_text')] ...| ALL }] [ SORT = [(n)]variable [(A)|(D)], ...] [ BOOLEAN = ( logical_expression ) ] [ SAMPLE = fraction]
FILENAME
| Specifies the filename created by the procedure. |
VARIABLES
|
Specifies the procedure variables that are written to the output
file. Specify the variables in the order in which they are to appear in the
output file. If this option is not specified or the keyword
ALL is specified, the default variables are output.Specify any header text in quotes in parentheses following the variable name. If header text is not specified, the variable name is used. |
SORT
| Specifies the sequence of the output. n is an integer that specifies the maximum number of records to be sorted. The default for this parameter is either the number of records in the database or the value specified in the sortn parameter and need only be specified if the number of records in the procedure table is greater than the default. The procedure table is sorted by the specified variables in variable list order. A variable name followed by (A) or (D) specifies that for that variable the sort is in Ascending order (the default) or in Descending order. |
BOOLEAN
| Specifies which procedure table records are used by the procedure. The procedure table records for which the logical expression is true are used by the procedure. If this option is not specified, all procedure table records are used. |
SAMPLE
|
Specifies that a random sample of the procedure table records are
used by the procedure. The fraction specifies the percent of records used and is specified as a positive decimal number less than or equal to 1 (one). .25, for example specifies that a 25% sample be used. |
DBASE
file is created containing each
employee's name, social security number and birth date. The variable names are
used as the default column headers. BIRTHDAY
is converted to
a string in a date format before being sent to the procedure.
RETRIEVAL STRING*12 BDAY PROCESS CASES . PROCESS REC EMPLOYEE . GET VARS NAME SSN . COMPUTE BDAY = DATEC(BIRTHDAY,'Mmm DD, YYYY') . PERFORM PROCS . END REC END CASE Dbase SAVE FILE FILENAME = DBASE.OUT / END RETRIEVALWhen the above program is run, the following summary report is displayed:
DBASE SAVE FILE Summary Report ------------------------------ No of data records ..... 20 No of columns .......... 3
RETRIEVAL PROCESS CASES . PROCESS REC EMPLOYEE . GET VARS NAME SSN . COMPUTE BDAY = DATEC(BIRTHDAY,'Mmm DD, YYYY') . PERFORM PROCS . END REC END CASE DBASE SAVE FILE FILENAME = DBASE.OUT / SORT = SSN / VARIABLES = NAME ('Employee Name') SSN ('Soc Sec Number') BDAY ('Birthday') END RETRIEVAL
SSN
and BDAY
called 'Dummy Two'
RETRIEVAL PROCESS CASES . PROCESS REC EMPLOYEE . GET VARS NAME SSN . COMPUTE BDAY = DATEC(BIRTHDAY,'Mmm DD, YYYY') . PERFORM PROCS . END REC END CASE DBASE SAVE FILE FILENAME = DBASE.OUT/ SORT = SSN / VARIABLES = ('Dummy One') NAME ('Employee Name') SSN ('Soc SecNumber') ('Dummy Two') BDAY ('Birthday') END RETRIEVAL