DROP and KEEP Subcommands (GET TRANSLATE command)
DROP and KEEP are used to copy a subset of variables
into the active dataset. DROP specifies the variables not to copy into the active dataset. KEEP specifies the variables to copy. Variables
not specified on KEEP are dropped.
-
DROPandKEEPcannot precede theFILEorTYPEsubcommands. -
DROPandKEEPspecifications use variable names. By default, this program uses the column letters from spreadsheets and the field names from databases as variable names. - If
FIELDNAMESis specified when translating from a spreadsheet, theDROPandKEEPsubcommands must refer to the field names, not the default column letters. - Variables can be specified in any order. Neither
DROPnorKEEPaffects the order of variables in the resulting file. Variables are kept in their original order. - If a variable is referred to twice on the same subcommand, only the first mention of the variable is recognized.
- Multiple
DROPandKEEPsubcommands are allowed; the effect is cumulative. Specifying a variable named on a previousDROPor not named on a previousKEEPresults in an error and the command is not executed. - If you specify both
RANGEandKEEP, the resulting file contains only variables that are both within the range and specified onKEEP. - If you specify both
RANGEandDROP, the resulting file contains only variables within the range and excludes those mentioned onDROP, even if they are within the range.
Example
GET TRANSLATE FILE='ADDRESS.DBF' /DROP=PHONENO, ENTRY.
-
GET TRANSLATEcreates an active dataset from the dBASE file ADDRESS.DBF, omitting the fields named PHONENO and ENTRY.
Example
GET TRANSLATE FILE='PROJECT.OCT' /TYPE=WK1 /FIELDNAMES
/KEEP=NETINC, REP, QUANTITY, REGION, MONTH, DAY, YEAR.
-
GET TRANSLATEcreates a active dataset from the 1-2-3 Release 2.0 file called PROJECT.OCT. - The subcommand
FIELDNAMESindicates that the first row of the spreadsheet contains field names, which will be translated into variable names in the active dataset. - The subcommand
KEEPtranslates columns with the field names NETINC, REP, QUANTITY, REGION, MONTH, DAY, and YEAR to the active dataset.