Question : The following SAS program is submitted: data _null_; set old (keep = prod sales1 sales2); file 'file-specification'; put sales1 sales2; run; Which one of the following default delimiters separates the fields in the raw data file created?
Exp: because no delimiter is specified at the end of the file stmt.so the default delimitter space is used.if you want comma as a delimitter, use the stmt file 'file specification' dlm=','; the default delimiter is 'space'. but, in case of 'DSD' option then default delimiter becomes 'comma'.
Question :
The contents of the raw data file TEAM are listed below: --------10-------20-------30 Janice 10 Henri 11 Michael 11 Susan 12 The following SAS program is submitted: data group; infile 'team'; input name $15. age 2.; file 'file-specification'; put name $15. +5 age 2.; run; Which one of the following describes the output created?
Exp: infile and input statements are used to read data from raw data file. File and put statements are used to write data to raw data file. In our example later is happening, so a raw data file is created and as data step is creating a dataset (it is not data _null_), it will create an output dataset too. So the answer is C raw data file and group dataset.
it's a data error not a syntax error! so the program will produce the data set named GROUP and a raw data file, with some missing values.
Question :The contents of the SAS data set named PERM.STUDENTS are listed below: name age Alfred 14 Alice 13 Barbara 13 Carol 14 The following SAS program is submitted using the PERM.STUDENTS data set as input: libname perm 'SAS-data-library'; data students; set perm.students; file 'file-specification'; put name $15. @5 age 2.; run; Which one of the following represents the values written to the output raw data file? 1. --------10-------20-------30 Alfred 14 Alice 13 Barbara 13 Carol 14 2. --------10-------20-------30 Alfr14 Alic13 Barb13a Caro14 3. Access Mostly Uused Products by 50000+ Subscribers --------10-------20-------30 Alfr14ed Alic13e Barb13ara Caro14l 4. --------10-------20-------30 Alfred 14 Alice 13 Barbara 13 Carol 14
Exp: Answer is 2 because @5 age 2. will not create space for itself but rather it will overwrite name $15, which is written first. So Alfred written by name variable will become Alfr14