DATA LIST
Defines variables and reads data typed into the syntax (with BEGIN DATA) or from a text file.
Syntax
Section titled “Syntax”DATA LIST [FIXED|FREE|LIST] [("delimiters")] [FILE='path'] [RECORDS=n] [SKIP=n] [TABLE|NOTABLE] / var start-end [(A|decimals|FORMAT)] … (FIXED, column style) / var var (format list: 2F5.1, A3, nX, Tn) … (FIXED, format style) / var [(FORMAT)] … (FREE and LIST)Synopsis
Section titled “Synopsis”| Kind | Data management |
| Body | free-form body |
| Changes data | yes, undoable |
Examples
Section titled “Examples”DATA LIST FIXED /name 1-10 (A) age 12-13 score 15-18 (2).BEGIN DATAAlice 34 1234END DATA.DATA LIST LIST (",") /id (F3) name (A10) score.BEGIN DATA1,"Smith, J",3.5END DATA.DATA LIST FREE / x y (2F5.1) label (A8).BEGIN DATA1 2 first 3 4 secondEND DATA.DATA LIST FILE='measurements.txt' FIXED RECORDS=2 /1 id 1-4 /2 weight 1-5 (1).- FIXED (the default) reads columns; FREE reads values separated by blanks or commas, letting a case run across lines; LIST reads one case per line.
- A format in parentheses applies to every variable named since the previous format, so
id name (A6)makes both strings. (2)after a column range means two implied decimals when the field has no decimal point.- A blank or ‘.’ field is system-missing. The data become a new active dataset (named data_list, or after the file).
- Date and time formats (DATE, ADATE, EDATE, SDATE, DATETIME, TIME, …) are read into OrcStat date values.
Related
Section titled “Related”Generated from OrcStat’s command registry and reference. To suggest a change, open an issue.