SAS

अब Quizwiz के साथ अपने होमवर्क और परीक्षाओं को एस करें!

define each part of the format <$>format<w>.<d>

$- Indicates a character format. format- Names the SAS format. w- Specifies the total format width, including decimal places and special characters. .- Is required syntax. Formats always contain a period (.) as part of the name. d- Specifies the number of decimal places to display in numeric formats.

correct syntax for a character format?

$nameWIDTH.

The descriptor portion contains the following metadata:

-general properties (such as data set name and number of observations) -variable properties (such as name, type, and length)

What is the displayed value of the stored value 0 with the format MMDDYY10.

01/01/1960

Name 5 rules for SAS variable names:

1. Can be 1 to 32 characters long. 2. Must start with a letter or underscore. 3. Subsequent characters can be letters, underscores, or numerals. 4. Can be uppercase, lowercase, or mixed case. 5. Are not case sensitive.

Name 3 characteristics specific to character variables:

1. Can contain any value: letters, numerals, special characters, and blanks 2. Range from 1 to 32,767 characters in length 3. Have 1 byte per character.

What are the steps in the programming process in order?

1. Define the business need. 2. Write a SAS program. 3. Run the program. 4. Review the results. 5. Debug or modify.

Name 3 characteristics specific to numeric variables

1. Store numeric values using floating point or binary representation 2. Have 8 bytes of storage by default 3. Can store 16 or 17 significant digits.

Name 5 characteristics of the title statement

1. Titles appear at the top of the page. 2. The default title is The SAS System. 3. The value of n can be from 1 to 10. 4. An unnumbered TITLE is equivalent to TITLE1. 5. Titles remain in effect until they are changed, canceled, or you end your SAS session.

Within the value statement in PROC FORMAT, each range be?

1. a single value 2. a range of values 3. a list of values.

Name the 6 characteristics of a value statement within proc format:

1. can be up to 32 characters in length 2. for character formats, must begin with a dollar sign ($), followed by a letter or underscore 3.for numeric formats, must begin with a letter or underscore 4. cannot end in a number 5. cannot be given the name of a SAS format 6. cannot include a period in the VALUE statement.

Within the value statement in PROC FORMAT, each label can be?

1. can be up to 32,767 characters in length 2. are enclosed in quotation marks.

How many characters can a label be?

256

What is the displayed value of the stored value 27134.5864 with the format DOLLAR5.2

27135

What is the displayed value of the stored value -1 with the format DATE9.

31DEC1959

Which variable names are invalid? data5mon 5monthsdata data#5 five months data five_months_data FiveMonthsData fivemonthsdata

5monthsdata data#5 five months data

What is a SAS data set?

A SAS data set is a specially structured data file that SAS creates and that only SAS can read. A SAS data set is a table that contains observations and variables.

What are attributes of a user-defined library?

A user-defined library -is created by the user. -is permanent. Data sets are stored until the user deletes them. -is not automatically available in a SAS session. -is implemented within the operating environment's file system.

Does this comment contain syntax errors? /* Report created for budget presentation; revised October 15. */ proc print data=work.newloan; run;

A. No. The comment is correctly specified. A block comment begins with a forward slash and an asterisk, followed by your comment text, and ends with an asterisk and forward slash. A block comment can be any length, and can contain semicolons.

You want the variables Birth_Date and Employee_Hire_Date to be labeled in your PROC PRINT report. What do you need to do to this program? proc print data=orion.employee_payroll; var Employee_ID Birth_Date Employee_Hire_Date Salary; label Birth_Date='Birth Date' Employee_Hire_Date='Hire Date'; run;

Add the LABEL option to the PROC PRINT statement. The LABEL statement is not a global statement. You can specify labels for multiple variables in one LABEL statement, or you can use a separate LABEL statement for each variable. To display temporary labels in your PROC PRINT report, you use the LABEL option in your PROC PRINT statement because PROC PRINT doesn't display labels automatically.

What result would you expect from submitting this step? proc print data=work.newsalesemps run;

An HTML report of the work.newsalesemps data set There is a missing semicolon following the data set name. When this step runs, SAS will interpret the word RUN as an option in the PROC PRINT statement (because of the missing semicolon). As a result, the PROC PRINT step will not execute and an error message will be displayed in the log.

What result would you expect from submitting this step? proc print data=work.newsalesemps run;

An error message in the log There is a missing semicolon following the data set name. When this step runs, SAS will interpret the word RUN as an option in the PROC PRINT statement (because of the missing semicolon). As a result, the PROC PRINT step will not execute and an error message will be displayed in the log.

The default PROC Contents report has three parts. They are:

Attributes - which contains general information about the data set Engine/Host Information - contains engine- and host-dependent information Variables - contains information about the variables. Every variable has three required attributes: Name, Type and Length. They are listed in alphabetical order by default.

Which of the following steps is typically used to generate reports and graphs? a. DATA b. PROC c. REPORT d. RUN

B. Proc PROC steps are typically used to process SAS data sets (that is, generate reports, graphs, and statistics).

What do you have to do so that a variable name can contain special characters?

By placing it in quotation marks immediately followed by the letter N. This is called a SAS name literal. For example, 'Flight#'n In order to use SAS name literals as variable names, the VALIDVARNAME= option must be set to ANY. Options validvarname=any; This setting is the default in SAS Enterprise Guide.

In SAS there are only two types of variables, what are they?

Character and Numeric

When you run this code, which title or titles appear in the last PROC PRINT output? title1 'The First Line'; title2 'The Second Line'; proc print data=orion.sales; run; title2 'The Next Line'; proc print data=orion.sales; run; title 'The Top Line'; proc print data=orion.sales; run;

Correct answer: The Top Line The TITLE statement in the last PROC PRINT step changes the first title line and cancels all previously specified titles with line numbers higher than 1.

SAS permits your programs to be free format. a. True b. False

Correct answer: True SAS statements are free format. In other words, they can begin and end anywhere. In SAS, you can have as much or as little white space as you want. According to SAS syntax rules, you can begin or end a statement in any column and span multiple lines. You can also place multiple statements on one line, and unquoted values can be lowercase, uppercase, or mixed case.

What type of data set is the input data set in this PROC PRINT step? proc print data=order_fact; run; a. temporary b. permanent c. There is not enough information to determine the type

Correct answer: a temporary When you specify a one-level data set name, SAS assumes the library is work and the data set is temporary.

SAS allows either single or double quotation marks. If you begin with a single quotation mark, you can end with a double quotation mark. a. True b. False

Correct answer: b Also, although SAS allows either single or double quotation marks, you can't mix the types. If you begin with a single quotation mark, you must end with a single quotation mark; otherwise, SAS considers the quotation marks unbalanced.

Obs EMP ID Employee Hire Date 1 120101 01JUL2001 2 120102 01JUN1989 3 120103 01JAN1974 4 120104 01JAN1981 5 120105 01MAY1999 6 120106 01JAN1974 a. proc print data=orion.staff; var Employee_ID Emp_Hire_Date; label Employee_ID='Emp ID' 'Employee_Hire Date'; run; b. proc print data=orion.staff split='+'; var Employee_ID Emp_Hire_Date; label Employee_ID='Emp ID' Emp_Hire_Date='Employee+Hire Date'; run;

Correct answer: b To display temporary labels in PROC PRINT output, you must specify either the SPLIT= option or the LABEL option in the PROC PRINT statement.

A comment is text in your program that SAS processes along with the other SAS steps in your program. a. True b. False

Correct answer: b false A comment is text in your program that SAS ignores during processing, but writes to the SAS log.

In this PROC CONTENTS output, what is the default length of the variable Birth_Date? Alphabetic List of Variables and Attributes # Variable Type Len Format 4 Birth_Date Num 8 Dependents Num 8 2 Employee_/Gender Char 1 5 Employee_Hire_Date Num 8 1 Employee_ID Num 8 12. 6 Employee_Term_Date Num 8 7 Marital_Status Char 1 3 Salary Num 8 a. 2 bytes b. 8 bytes c. 16 or 17 bytes d. 32,767 bytes

Correct answer: b, 8 bytes Birth_Date is a numeric variable, and the default length of numeric variables is 8 bytes

What happens if you submit the following program? porc print data=work.newsalesemps; run; a. SAS does not execute the step. b. SAS assumes that the keyword PROC is misspelled and executes the PROC PRINT step.

Correct answer: b, SAS assumes that the keyword PROC is misspelled and executes the PROC PRINT step. The log will indicate that SAS assumed that the keyword PROC was misspelled, corrected it temporarily, and executed the PROC step.

In this data set, what type of variable is Employee_ID? Obs Employee_ID Last Salary 1 . Ralston 29250 2 120101 Lu 163040 3 120104 Billington 46230 4 120105 Povey 27110 5 120106 Hornsey . a. character b. numeric c. temporary d. missing

Correct answer: b. numeric Employee_ID has a missing value that is displayed as a period. A missing value is displayed as a period for numeric variables and as a blank for character variables. Also, numeric values are right-justified and character values are left-justified by default.

Which of the following data sets will be available if you start a new SAS session? a. sales b. orion.sales c. work.newsalesemps d. newsalesemps

Correct answer: b. orion.sales Any library that you create is a permanent library and is available in subsequent SAS sessions. When a data set is in the temporary work library, you can optionally use a one-level name. A one-level name consists of only the data set name, such as sales or newsalesemps. When you specify a one-level name, SAS assumes that the data set is stored in the work library because work is the default libref.

Which of the following librefs is valid and why? a. 2010Car b. car/2010 c. Car_2012 d. 1_or_a

Correct answer: c, Car_2012 This libref follows all three rules for valid librefs. A libref must have a length of one to eight characters, and must begin with a letter or underscore. The remaining characters must be letters, numbers, or underscores.

In this data set, what do the values 72, 64, 68, and 76 represent? ID Height Weight Age 54209 72 165 35 38204 64 122 46 10462 68 154 28 38754 76 188 51 a. an observation b. four observations c. values of a variable

Correct answer: c, values of a variable These are the values for the variable Height. Recall that in SAS, the observations are the rows in a data set, and variables are the columns in a data set. The values 72, 64, 68, and 76 are displayed in the column for Height.

Which of the following is a SAS syntax requirement? a. Begin each statement in column one. b. Put only one statement on each line. c. Separate each step with a line space. d. End each statement with a semicolon. e. Put a RUN statement after every DATA or PROC step.

Correct answer: d End each statement with a semicolon. SAS statements usually begin with an identifying keyword, and they must end with a semicolon. Although it is recommended to end steps with a RUN statement, it is optional. The other listed items are related to formatting your programs to make them easier to read.

Which of the following statements selects rows in which Amount is less than or equal to $5,000 or Rate equals 0.095? a. where amount <= 5000 or rate=0.095; b. where amount le 5000 or rate=0.095; c. where amount <= 5000 or rate eq 0.095; d. all of the above

Correct answer: d, all of the above All of the statements shown here select rows in which Amount is less than or equal to $5000 or Rate equals 0.095.

Which BY statement is valid for this PROC PRINT step? proc sort data=orion.staff out=work.staff_sort; by Gender Start_Date; run; proc print data=work.staff_sort label; by _____________________________; label Start_Date='Start'; run; a. by Start_Date Gender; b. by Start; c. by descending Gender; d. by Gender;

Correct answer: d, by Gender; You can group by Gender because Gender is the first variable that the data set is sorted by. You could also group by Gender and then Start_Date because the data set is sorted by these variables in the same order. You cannot use the other BY statements because the variables are not specified for grouping in the same order that the data set is sorted.

Which of the following statements selects from a data set only those observations for which the value of the variable Style is RANCH, SPLIT, or TWOSTORY? a. where Style='RANCH' or 'SPLIT' or 'TWOSTORY'; b. where Style in 'RANCH' or 'SPLIT' or 'TWOSTORY'; c. where Style in (RANCH, SPLIT, TWOSTORY); d. where Style in ('RANCH','SPLIT','TWOSTORY');

Correct answer: d. where Style in ('RANCH','SPLIT','TWOSTORY'); In the WHERE statement, the IN operator enables you to select observations based on several values. You specify values in parentheses and separate them by spaces or commas. Character values must be enclosed in quotation marks and must be in the same case as in the data set.

In which portion of a SAS data set are the following found? name of the data set type of the variable Salary creation date of the data set a. descriptor portion b. data portion

Correct answer: descriptor portion The descriptor portion contains general properties, such as the data set name and number of observations. It also contains the variable properties, including the name, type, and length of variables. The data portion contains the data, or variable values.

Does 50000 < - 100000 include/exclude the bounds?

Excludes 50000 Includes 100000

True/False: SAS Formats modifies the underlying data values

FALSE! Only changes how we are displaying it, not going to modify the values that we have stored in the data set.

What is the format syntax?

FORMAT variable(s) format ...; ex format Salary dollar8. Hire_Date mmddyy10.;

A numeric variable can store numeric values with a maximum of eight digits. a. True b. False

False Numeric values are stored in floating point notation in 8 bytes of storage, allowing a maximum of 16-17 digits.

To disassociate a libref that you previously assigned, you can use the UNASSIGN option in the LIBNAME statement. a. True b. False

False You use the CLEAR option in the LIBNAME statement to cancel, or disassociate, a libref that you previously assigned.

True or False: For numeric variables, the low keyword include missing values?

False, does not include missing values for numeric variables.

True or False, The DESCENDING option reverses the sort order for all of the variable that follows it.

False. The DESCENDING option reverses the sort order for the variable that immediately follows it. The observations are sorted from the largest value to the smallest value.

How are missing values represented for numeric and character values:

For character variables: missing values will be blank For numeric variables: missing values will be a period

What happens when you use a BY statement and a SUM statement in a PROC PRINT step.

Generate subtotals

Which data equals date 0?

January 1, 1960:

What is the label statement syntax

LABEL variable-1='label '

The SAS LIBNAME statement is a global SAS statement with that syntax and what are attributes of this statement?

LIBNAME libref "SAS-library" <options>; -It is not required to be in a DATA step or PROC step. -It does not require a RUN statement. -It executes immediately. -It remains in effect until changed or canceled, or until the session ends.

Where should 'label' appear in your code in proc print?

Label option in proc print first line Label statement with the labels for each specified variable

What is the format for stored value 0 and displayed value 010160?

MMDDYY6.

Does the sort procedure produce a report?

No

title1 'RADIX Company'; title3 'DVD Sales'; proc print data=radix.sales; where UnitSold>=30; run; title2 'Best Sales; title; proc print data=radix.staff; where Sales>25000; run;

No titles will appear at the top of the second PROC PRINT report. The null TITLE statement above that statement cancels all previously specified titles.

Are raw data files created only by SAS?

No, Raw data files are files that contain non-software-specific data.

Does this comment contain syntax errors? /* Report created for budget presentation; revised October 15. */ proc print data=work.newloan; run;

No. The comment is correctly specified. A block comment can contain semicolons and unbalanced quotation marks, can appear anywhere, and doesn't need a semicolon at the end.

Which observation or observations will be selected by the following WHERE statement? where Job_Title contains 'I'; Obs Last_Name First_Name Country Job_Title 1 Wu Christine AU Sales Rep I 2 StoneKimiko AU Sales Manager 3 Hoffman Fred AU Insurance Sales

Observations 1 and 3 Expressions in the WHERE statement are case sensitive. This WHERE statement returns only those values that contain the exact character string shown. The position of the substring within the value is not important.

What is the keyword in the sort procedure so you do not replace the original dataset?

Out=

What is the syntax for proc contents?

PROC CONTENTS DATA=SAS-data-set; RUN;

What is the syntax for a user defined format?

PROC FORMAT; VALUE format-name range1 = 'label ' range2 = 'label ' . . . ; RUN;

Which of the following steps is typically used to generate reports and graphs? a. DATA b. PROC c. REPORT d. RUN

PROC steps are typically used to process SAS data sets (that is, generate reports, graphs, and statistics).

Are the variables names part of the data portion or the descriptor portion?

Part of the descriptor portion

What procedure in SAS do you use to view the descriptor portion of a data set?

Proc Contents

What are the 2 types of formats?

SAS Formats User-Defined Formats

In SAS we generally refer to: SAS Tables as? Rows as? Columns as?

SAS Tables as SAS data sets Rows as observations Columns as variables.

What happens if you submit the following program? porc print data=work.newsalesemps; run;

SAS assumes that the keyword PROC is misspelled and executes the PROC PRINT step.

What does a SAS program file contain?

SAS program files contain SAS programming code. These instructions tell SAS how to process your data and what output to create.

How many step boundaries does this program contain? data work.staff; length First_Name $ 12 Last_Name $ 18 Job_Title $ 25; infile "&path/newemployees.csv" dlm=','; input First_Name $ Last_Name$ Job_Title $ Salary; run; proc print data=work.staff; run; proc means data=work.staff; var Salary; run;

SIX RUN, QUIT, DATA, and PROC statements function as step boundaries, which determine when SAS statements take effect and indicate the end of the current step or the beginning of a new step.

What is the sashelp library?

Sashelp is a permanent library that contains sample SAS data sets you can access during your SAS session.

How do you create a grouped report?

Step 1 Use the SORT procedure to group data in a data set. Step 2 Use a BY statement in PROC PRINT to display the sorted observations grouped by the variable of interest.

Are labels inside proc print temporary or permanent?

Temporary

All SAS data sets have a two-level name that consists of?

The libref and the data set name, separated by a period. libref.data-set-name

How do you Cancel All Titles and Footnotes?

The null TITLE statement cancels all titles. The null FOOTNOTE statement cancels all footnotes. title; footnote;

What happens if you do not clear a title?

The title will continue on all other output until you clear it.

When listing your user-defined format in the proc print step, what is important not to forget?

There must be a period after the user-defined format or you will get errors, you do not need the period in the proc format step only in the proc print step

How is a value of 50000 displayed if the TIERS format below is applied to the value? proc format; value tiers 20000-<50000 ='Tier 1' 50000-<100000='Tier 2' 100000-250000='Tier 3'; run;

Tier 2

How do you change a libref and how do you cancel a libref?

To change a libref, submit a LIBNAME statement with the same libref but a different path. To cancel a libref, submit a LIBNAME statement with the CLEAR option. ex: libname orion clear;

How do you change a title or footnote

To change a title line, submit a TITLE statement with the same number but different text. This replaces a previous title with the same number. It cancels all titles with higher numbers.

True or False: If there are multiple after the format statement variables listed in front of a specific format it will apply to all of them

True

When you submit a program containing unbalanced quotation marks in SAS Enterprise Guide, you can simply correct the error and resubmit the program. a. True b. False

True SAS keeps a running total of the number of quotation marks in your code. In the windowing environment, an odd number of quotation marks would cause the program to hang; you would have to stop the program before adding the missing quotation mark and resubmitting the program. In contrast, SAS Enterprise Guide automatically adds wrapper code that programmatically balances quotations marks to prevent your program from hanging.

True of False: For character variables, the low keyword includes missing values?

True, includes missing values for character variables

How many titles can you have maximum and what size are they?

Up to 10, they are all the same size

Using SAS, you can read any kind of data?

Using SAS, you can read any kind of data. You might have data stored in SAS, in a raw data file, in Oracle, in Excel, or in other types of files.

What does SPLIT='split-character' in proc print do?

Will split the line of the label where the given character is types in the label statement You also do not need to specify label option in proc print when you specify split

When a SAS session starts, SAS creates one temporary and at least one permanent SAS library. What is the temporary library called?

Work, Work is a temporary library where you can store and access SAS data sets for the duration of the SAS session. It is the default library. Sas will delete the library as soon as you end the sas session.

COMMAw.d

Writes numeric values with a comma that separates every three digits and a period that separates the decimal fraction.

DOLLARw.d

Writes numeric values with a leading dollar sign, a comma that separates every three digits, and a period that separates the decimal fraction.

EUROXw.d

Writes numeric values with a leading euro symbol (€), a period that separates every three digits, and a comma that separates the decimal fraction.

COMMAXw.d

Writes numeric values with a period that separates every three digits and a comma that separates the decimal fraction.

$w.

Writes standard character data.

w.D

Writes standard numeric data.

Are SAS data sets created only by SAS?

Yes

Can you sort on multiple variables?

Yes

Can you reuse SAS programs?

You can save and reuse SAS program files.

What does the VARNUM option in proc contents do?

You can use the VARNUM option to display the variables in creation or numeric order instead of alphabetic order.

Suppose you submit a short, simple DATA step. If the active window displays the message DATA step running for a long time, what probably happened?

You forgot to end the DATA step with a RUN statement. Without a RUN statement (or a following DATA or PROC step), the DATA step doesn't execute. Unbalanced quotation marks can also cause the DATA step running message if relatively little code follows the unbalanced quotation mark. The other three problems above generate errors in the Log window.

What is the output of the following code: proc sort data=orion.sales out=work.sales; by Country descending Salary; run; proc print data=work.sales noobs; by descending Country; run;

You will get output but you have errors in the log, because it was unable to sort by descending order of Country.

Which LIBNAME statement has the correct syntax? a. libname reports 'filepath/workshop'; b. libname orion filepath/workshop; c. libname 3456a 'filepath/workshop';

Your answer: libname reports 'filepath/workshop'; In a basic LIBNAME statement, you specify the keyword LIBNAME, a valid libref, and then the physical name of the library in quotation marks.

Use PROC CONTENTS with what keyword to generate a list of all SAS files in a library? How do you suppresses the individual data set descriptor information?

_ALL_ The NODS option NODS can be used only with the keyword _ALL_.

The format name must include a period delimiter in the FORMAT statement. a. True b. False

a. true The period is a required syntax in a format name within a FORMAT statement.

Where do global statements appear?

anywhere in a SAS program Global statements can appear anywhere in a SAS program—either inside or outside of DATA and PROC steps—and can affect more than one step.

Which names are invalid for user-defined formats? a. $stfmt b. $3levels c. _4years d. salranges e. dollar

b. $3levels and e. dollar Character formats must have a dollar sign as the first character and a letter or underscore as the second character. User-defined formats cannot be given the name of a format provided by SAS.

Which of the following is a valid name for a character format? a. country b. $ctry c. $country. d. _country

b. $ctry Character formats must start with a dollar sign followed by a letter or underscore. A format name does not end with a period. The period is a required delimiter when using a format in a FORMAT statement.

Which statement about this program is true? proc print data=orion.sales; var Employee_ID Salary; where Country='AU'; by Gender; label Salary='Annual Salary'; run; a. This program will run correctly only if orion.sales is sorted in ascending order by Country. b. The PROC PRINT report displays only the observations in which the value of Country is AU. c. The label and format specified in the program are stored in orion.sales.

b. The PROC PRINT report displays only the observations in which the value of Country is AU The WHERE statement subsets the data so that the report displays only the observations in which the value of Country is AU. The input data set must be sorted by Gender, the variable specified in the BY statement. The LABEL and FORMAT statements affect only the report output; they do not affect the input data set.

A FORMAT statement is used only to apply SAS formats. a. True b. False

b. false A FORMAT statement is used to apply both SAS and user-defined formats.

A format modifies both the stored value and the displayed value. a. True b. False

b. false A format affects the way a value is displayed. It does not change the stored value in any way.

You specify the variable to which a format applies when creating it in a PROC FORMAT step. a. True b. False

b. false Formats are not associated with a specific variable until they are applied with a FORMAT statement.

You can use either < or > to define a non-inclusive range in a VALUE statement. a. True b. False

b. false You can only use the < symbol to define a non-inclusive range.

Which statement about this PROC SORT step is true? proc sort data=orion.staff; out=work.staff_sort; by descending Salary Manager_ID; run; a. The sorted data set overwrites the input data set. b. The observations are sorted by Salary in descending order, and then by Manager_ID in descending order. c. A semicolon should not appear after the input data set name. d. The sorted data set contains only the variables specified in the BY statement.

c. A semicolon should not appear after the input data set name. This PROC SORT step has a syntax error: a semicolon in the middle of the PROC SORT statement. If you correct this syntax error, this step sorts orion.staff by Salary in descending order and by Manager_ID in ascending order. The step then creates the temporary data set work.staff_sort that contains the sorted observations and all variables.

Which of the following is not a valid user-defined format name? a. $month b. group_a c. comma d. _gender

c. comma Character formats must start with a dollar sign followed by a letter or underscore. Numeric formats must start with a letter or underscore. A format cannot be created with the name of an existing SAS format, so comma is invalid.

Which of the following is a SAS syntax requirement? a. Begin each statement in column one. b. Put only one statement on each line. c. Separate each step with a line space. d. End each statement with a semicolon. e. Put a RUN statement after every DATA or PROC step.

d. End each statement with a semicolon. All SAS statements must end with a semicolon, but they are free-format. You can begin or end them anywhere, separate steps with line spaces, and optionally end steps with a RUN statement.

Given this $TITLE format, what would display for a value of Sales Rep II? proc format; value $title 'Sales Manager', 'Senior Sales Mgr'='Manager' 'Sales Rep. I', 'Sales Rep. II'='Rep'; run;

d. Sales R The data value does not match any of the values listed in the VALUE statement, so PROC PRINT will display the stored value. However, the width of the column is 7, the width of the longest format value, 'Manager', so truncation occurs in the output.

What FORMAT statement creates the output shown below? Birth_Date Hire_Date Term_Date 21/05/1969 15/10/1992 MAR2007

format Birth_Date Hire_Date ddmmyy10. Term_Date monyy7.;

Which of the following correctly assigns the libref myfiles to a SAS library in the c:\mysasfiles folder? libname orion myfiles "c:\mysasfiles"; libname myfiles "c:\mysasfiles"; libref orion myfiles "c:\mysasfiles"; libref myfiles "c:\mysasfiles";

libname myfiles "c:\mysasfiles";

correct syntax for a numeric format?

nameWIDTH.DECIMAL

What are the 2 types of sas libraries?

permanent or temporary

Which is more efficient: proc sort data=orion.sales out=work.sales; /* where Salary<25500; */ by Country descending Salary; run; proc print data=work.sales noobs; by Country; sum Salary; /* where Salary<25500; */ var First_Name Last_Name Gender Salary; run;

proc sort data=orion.sales out=work.sales; /* where Salary<25500; */ by Country descending Salary; run; The Where statement in the proc sort step

Which step sorts the observations in a SAS data set and overwrites the same data set? proc sort data=work.EmpsAU out=work.sorted; by First; run; proc sort data=orion.EmpsAU out=EmpsAU; by First; run; proc sort data=work.EmpsAU; by First; run;

proc sort data=work.EmpsAU; by First; run; Since there is no out= statement, First will replace the original dataset.

How many step boundaries does this program contain? data work.staff; length First_Name $ 12 Last_Name $ 18 Job_Title $ 25; infile "&path\newemployees.csv" dlm=','; input First_Name $ Last_Name$ Job_Title $ Salary; run; proc print data=work.staff; run; proc means data=work.staff; var Salary; run;

six RUN, QUIT, DATA, and PROC statements function as step boundaries, which determine when SAS statements take effect and indicate the end of the current step or the beginning of a new step


संबंधित स्टडी सेट्स

Busi 1301 Toombs Weatherford College - Quiz 5

View Set

A&P II Ch. 23: Respiratory System

View Set

Principles of Marketing: Ch. 3 Prep

View Set