Excellent Ways of Exporting SAS Data to Excel
- 格式:pdf
- 大小:627.49 KB
- 文档页数:12
学会使用SAS分析数据与统计Chapter 1: Introduction to SASSAS (Statistical Analysis System) is a powerful software suite widely used in data analysis and statistics. It provides a comprehensive range of tools for managing, analyzing, and visualizing data. In this chapter, we will explore the basics of SAS and its key features.1.1 Overview of SASSAS was developed by the SAS Institute in the late 1960s and has since become a standard in data analysis. It offers a user-friendly interface and a rich programming language, making it suitable for both beginners and advanced users. SAS supports data manipulation, statistical analysis, data visualization, and reporting.1.2 SAS ComponentsSAS consists of several components, including Base SAS,SAS/STAT, SAS/GRAPH, and SAS/ETS. Base SAS provides the foundation for data access, data manipulation, and basic procedures. SAS/STAT offers advanced statistical analysis procedures, whileSAS/GRAPH enables the creation of high-quality graphical outputs. SAS/ETS specializes in econometrics and time series analysis.1.3 SAS Language BasicsThe SAS language is used to interact with SAS software. It is composed of statements, which are instructions that tell SAS what to do.SAS programs are made up of a series of statements, and the order of the statements is important. SAS statements have a specific structure, consisting of a keyword, options, and parameters.Chapter 2: Data Import and Export Using SASImporting and exporting data are crucial steps in any data analysis workflow. In this chapter, we will delve into various methods of data import and export using SAS.2.1 Importing DataSAS provides efficient ways to import data from various file types, such as CSV, Excel, and database files. The IMPORT procedure in SAS allows users to read data from external sources and store them in SAS datasets. Additionally, SAS supports the direct import of data from relational databases using SQL queries.2.2 Exporting DataSimilarly, SAS provides multiple options for exporting data. The EXPORT procedure allows users to save SAS datasets as external files in various formats, such as CSV, Excel, and HTML. Moreover, SAS enables the execution of SQL queries to directly export data from relational databases.Chapter 3: Data Manipulation in SASData manipulation is a critical part of data analysis. In this chapter, we will explore the various tools and techniques available in SAS for data manipulation.3.1 Data CleaningData cleaning involves identifying and correcting errors, inconsistencies, and missing values in datasets. SAS offers numerous functions and procedures to identify and treat missing values, remove duplicates, and handle outliers efficiently.3.2 Data TransformationData transformation involves converting data from one form to another. SAS provides a wide range of functions to perform various transformations, such as variable recoding, merging datasets, and creating new variables based on existing ones. These transformations are essential for preparing data for statistical analysis.Chapter 4: Statistical Analysis with SASSAS is widely recognized for its comprehensive statistical analysis capabilities. In this chapter, we will explore some popular statistical procedures available in SAS.4.1 Descriptive StatisticsSAS provides a variety of procedures to calculate descriptive statistics, such as mean, median, standard deviation, and percentiles.These procedures enable users to summarize and understand the characteristics of their datasets.4.2 Hypothesis TestingHypothesis testing is used to make inferences and draw conclusions about population parameters based on sample data. SAS offers a range of procedures for conducting hypothesis tests, including t-tests, ANOVA, and chi-square tests.4.3 Regression AnalysisRegression analysis is a fundamental statistical technique used to model the relationship between a dependent variable and one or more independent variables. SAS provides numerous regression procedures, such as linear regression, logistic regression, and multilevel regression.Chapter 5: Data Visualization in SASVisualizing data is essential for gaining insights and communicating results effectively. In this chapter, we will explore the visualization capabilities of SAS.5.1 SAS/GRAPHSAS/GRAPH offers a collection of procedures and tools for creating a wide range of static graphs, including bar charts, histograms, scatterplots, and maps. These graphical outputs help users understand the patterns and relationships in their data.5.2 SAS Visual AnalyticsSAS Visual Analytics is a web-based tool that allows users to create interactive and dynamic visualizations. It supports a wide range of charts, dashboards, and reports, and enables users to drill down and explore data interactively.Chapter 6: Reporting and Publishing with SASIn this final chapter, we will explore the reporting and publishing capabilities of SAS.6.1 SAS Output Delivery System (ODS)The Output Delivery System (ODS) in SAS enables users to generate reports in various formats, such as PDF, HTML, and Excel. ODS provides flexible options for customizing the appearance and layout of reports, making them suitable for different audiences.6.2 SAS Web Report StudioSAS Web Report Studio is a web-based reporting tool that allows users to create and share interactive reports. It offers a user-friendly interface and supports various data sources, enabling users to generate reports with up-to-date information.Conclusion:SAS is a powerful tool for data analysis and statistical modeling. This article has provided an overview of SAS, discussed itscomponents, covered data import and export, data manipulation, statistical analysis, data visualization, and reporting capabilities. With its extensive features and user-friendly interface, SAS is widely used in various industries for interpreting and analyzing data.。
SAS Certificate Base Practice Questions and Detailed Answers Chapter 1: Basic ConceptsChapter 2: Referencing Files and Setting OptionsChapter 3: Editing and Debugging SAS ProgramsChapter 4: Creating List ReportsChapter 5: Creating SAS Data Sets from Raw DataChapter 6: Understanding DATA Step ProcessingChapter 7: Creating and Applying User-Defined FormatsChapter 8: Creating Enhanced List and Summary ReportsChapter 9: Producing Descriptive StatisticsChapter 10: Producing HTML OutputChapter 11: Creating and Managing VariablesChapter 12: Reading SAS Data SetsChapter 13: Combining SAS Data SetsChapter 14: Transforming Data with SAS FunctionsChapter 15: Generating Data with DO LoopsChapter 16: Processing Variables with ArraysChapter 17: Reading Raw Data in Fixed FieldsChapter 18: Reading Free-Format DataChapter 19: Reading Date and Time ValuesChapter 20: Creating a Single Observation from Multiple RecordsChapter 21: Creating Multiple Observations from a Single RecordChapter 22: Reading Hierarchical FilesChapter 1: Basic Concepts Answer Key1.How many observations and variables does the data set below contain?a. 3 observations, 4 variablesb. 3 observations, 3 variablesc. 4 observations, 3 variablesd.can't tell because some values are missingCorrect answer:cRows in the data set are called observations, and columns are called variables. Missing values don't affect the structure of the data set.2.How many program steps are executed when the program below is processed?data user.tables;infile jobs;input date name $ job $;run;proc sort data=user.tables;by name;run;proc print data=user.tables;run;a.threeb.fourc.fived.sixCorrect answer:aWhen it encounters a DATA, PROC, or RUN statement, SAS stops reading statements andexecutes the previous step in the program. The program above contains one DATA step and two PROC steps, for a total of three program steps.3.What type of variable is the variable AcctNum in the data set below?a.numericb.characterc.can be either character or numericd.can't tell from the data shownCorrect answer:bIt must be a character variable, because the values contain letters and underscores, which are not valid characters for numeric values.4.What type of variable is the variable Wear in the data set below?a.numericb.characterc.can be either character or numericd.can't tell from the data shownCorrect answer:aIt must be a numeric variable, because the missing value is indicated by a period rather than by a blank.5.Which of the following variable names is valid?a.4BirthDateb.$Costc._Items_d.Tax-RateCorrect answer:cVariable names follow the same rules as SAS data set names. They can be 1 to 32 characters long, must begin with a letter (A–Z, either uppercase or lowercase) or an underscore, and can continue with any combination of numbers, letters, or underscores.6.Which of the following files is a permanent SAS file?a.Sashelp.PrdSaleb.Sasuser.MySalesc.Profits.Quarter1d.all of the aboveCorrect answer:dTo store a file permanently in a SAS data library, you assign it a libref other than the default Work. For example, by assigning the libref Profits to a SAS data library, you specify that files within the library are to be stored until you delete them. Therefore, SAS files in the Sashelp and Sasuser libraries are permanent files.7.In a DATA step, how can you reference a temporary SAS data set named Forecast?a.Forecastb.Work.Forecastc.Sales.Forecast (after assigning the libref Sales)d.only a and b aboveCorrect answer:dTo reference a temporary SAS file in a DATA step or PROC step, you can specify the one-level name of the file (for example, Forecast) or the two-level name using the libref Work (for example, Work.Forecast).8.What is the default length for the numeric variable Balance?a. 5b. 6c.7d.8Correct answer:dThe numeric variable Balance has a default length of 8. Numeric values (no matter how many digits they contain) are stored in 8 bytes of storage unless you specify a different length.9.How many statements does the following SAS program contain?proc print data=new.prodsalelabel double;var state day price1 price2; where state='NC';label state='Name of State';run;a.threeb.fourc.fived.sixCorrect answer:cThe five statements are•PROC PRINT statement (two lines long)•VAR statement•WHERE statement (on the same line as the VAR statement)•LABEL statement•RUN statement (on the same line as the LABEL statement).10.What is a SAS data library?a. a collection of SAS files, such as SAS data sets and catalogsb.in some operating environments, a physical collection of SAS filesc.in some operating environments, a logically related collection of SAS filesd.all of the aboveCorrect answer:dEvery SAS file is stored in a SAS data library, which is a collection of SAS files, such as SAS data sets and catalogs. In some operating environments, a SAS data library is a physical collection of files. In others, the files are only logically related. In the Windows and UNIX environments, a SAS data library is typically a group of SAS files in the same folder or directory.Chapter 2: Referencing Files and Setting Options1.If you submit the following program, how does the output look?options pagesize=55 nonumber;proc tabulate data=clinic.admit;class actlevel;var age height weight;table actlevel,(age height weight)*mean;run;options linesize=80;proc means data=clinic.heart min max maxdec=1;var arterial heart cardiac urinary;class survive sex;run;a.The PROC MEANS output has a print line width of 80 characters, but the PROCTABULATE output has no print line width.b.The PROC TABULATE output has no page numbers, but the PROC MEANS outputhas page numbers.c.Each page of output from both PROC steps is 55 lines long and has no page numbers,and the PROC MEANS output has a print line width of 80 characters.d.The date does not appear on output from either PROC step.Correct: answer:cWhen you specify a system option, it remains in effect until you change the option or end your SAS session, so both PROC steps generate output that is printed 55 lines per page with no page numbers. If you don't specify a system option, SAS uses the default value for that system option.2.In order for the date values 05May1955 and 04Mar2046 to be read correctly, what value mustthe YEARCUTOFF= option have?a. a value between 1947 and 1954, inclusiveb.1955 or higherc.1946 or higherd.any valueCorrect answer:dAs long as you specify an informat with the correct field width for reading the entire date value, the YEARCUTOFF= option doesn't affect date values that have four-digit years.3.When you specify an engine for a library, you are always specifyinga.the file format for files that are stored in the library.b.the version of SAS that you are using.c.access to other software vendors' files.d.instructions for creating temporary SAS files.Correct answer:aA SAS engine is a set of internal instructions that SAS uses for writing to and reading from files in a SAS library. Each engine specifies the file format for files that are stored in the library, which in turn enables SAS to access files with a particular format. Some engines access SAS files, and other engines support access to other vendors' files.4.Which statement prints a summary of all the files stored in the library named Area51?a.proc contents data=area51._all_ nods;b.proc contents data=area51 _all_ nods;c.proc contents data=area51 _all_ noobs;d.proc contents data=area51 _all_.nods;Correct answer:aTo print a summary of library contents with the CONTENTS procedure, use a period to append the _ALL_ option to the libref. Adding the NODS option suppresses detailed information about the files.5.The following PROC PRINT output was created immediately after PROC TABULATEoutput. Which SAS system options were specified when the report was created?a.OBS=, DATE, and NONUMBERb.PAGENO=1, and DATEc.NUMBER and DATE onlyd.none of the aboveCorrect answer:bClearly, the DATE and PAGENO= options are specified. Because the page number on the output is 1, even though PROC TABULATE output was just produced. If you don't specify PAGENO=, all output in the Output window is numbered sequentially throughout your SAS session.6.Which of the following programs correctly references a SAS data set named SalesAnalysisthat is stored in a permanent SAS library?a.data saleslibrary.salesanalysis;set mydata.quarter1sales;if sales>100000;run;b.data mysales.totals;set sales_99.salesanalysis;if totalsales>50000;run;c.proc print data=salesanalysis.quarter1;var sales salesrep month;run;d.proc freq data=1999data.salesanalysis;tables quarter*sales; run;Correct answer:bLibrefs must be 1 to 8 characters long, must begin with a letter or underscore, and can contain only letters, numbers, or underscores. After you assign a libref, you specify it as the first element in the two-level name for a SAS file.7.Which time span is used to interpret two-digit year values if the YEARCUTOFF= option isset to 1950?a.1950-2049b.1950-2050c.1949-2050d.1950-2000Correct answer:aThe YEARCUTOFF= option specifies which 100-year span is used to interpret two-digit year values. The default value of YEARCUTOFF= is 1920. However, you can override the default and change the value of YEARCUTOFF= to the first year of another 100-year span. If you specify YEARCUTOFF=1950, then the 100-year span will be from 1950 to 2049.8.Asssuming you are using SAS code and not special SAS windows, which one of thefollowing statements is false?a.LIBNAME statements can be stored with a SAS program to reference the SAS libraryautomatically when you submit the program.b.When you delete a libref, SAS no longer has access to the files in the library.However, the contents of the library still exist on your operating system.c.Librefs can last from one SAS session to another.d.You can access files that were created with other vendors' software by submitting aLIBNAME statement.Correct answer:cThe LIBNAME statement is global, which means that librefs remain in effect until you modify them, cancel them, or end your SAS session. Therefore, the LIBNAME statement assigns the libref for the current SAS session only. You must assign a libref before accessingSAS files that are stored in a permanent SAS data library.9.What does the following statement do?libname osiris spss 'c:\myfiles\sasdata\data';a.defines a library called Spss using the OSIRIS engineb.defines a library called Osiris using the SPSS enginec.defines two libraries called Osiris and Spss using the default engined.defines the default library using the OSIRIS and SPSS enginesCorrect answer:bIn the LIBNAME statement, you specify the library name before the engine name. Both are followed by the path.10.What does the following OPTIONS statement do?options pagesize=15 nodate;a.suppresses the date and limits the page size of the logb.suppresses the date and limits the vertical page size for text outputc.suppresses the date and limits the vertical page size for text and HTML outputd.suppresses the date and limits the horizontal page size for text outputCorrect answer:bThese options affect the format of listing output only. NODATE suppresses the date and PAGESIZE= determines the number of rows to print on the page.Chapter 3: Editing and Debugging SAS Programs Answer Key1.As you write and edit SAS programs it's a good idea toa.begin DATA and PROC steps in column one.b.indent statements within a step.c.begin RUN statements in column one.d.all of the aboveCorrect answer:dAlthough you can write SAS statements in almost any format, a consistent layout enhances readability and enables you to understand the program's purpose. It's a good idea to begin DATA and PROC steps in column one, to indent statements within a step, to begin RUN statements in column one, and to include a RUN statement after every DATA step or PROC step.2.What usually happens when an error is detected?a.SAS continues processing the step.b.SAS continues to process the step, and the log displays messages about the error.c.SAS stops processing the step in which the error occurred, and the log displaysmessages about the error.d.SAS stops processing the step in which the error occurred, and the program outputdisplays messages about the error.Correct answer:cSyntax errors generally cause SAS to stop processing the step in which the error occurred. When a program that contains an error is submitted, messages regarding the problem also appear in the SAS log. When a syntax error is detected, the SAS log displays the word ERROR, identifies the possible location of the error, and gives an explanation of the error.3. A syntax error occurs whena.some data values are not appropriate for the SAS statements that are specified in aprogram.b.the form of the elements in a SAS statement is correct, but the elements are not validfor that usage.c.program statements do not conform to the rules of the SAS language.d.none of the aboveCorrect canswer:Syntax errors are common types of errors. Some SAS system options, features of the Editorwindow, and the DATA step debugger can help you identify syntax errors. Other types oferrors include data errors, semantic errors, and execution-time errors.4.How can you tell whether you have specified an invalid option in a SAS program?a. A log message indicates an error in a statement that seems to be valid.b. A log message indicates that an option is not valid or not recognized.c.The message "PROC running" or "DATA step running" appears at the top of theactive window.d.You can't tell until you view the output from the program.Correct answer:bWhen you submit a SAS statement that contains an invalid option, a log message notifies you that the option is not valid or not recognized. You should recall the program, remove or replace the invalid option, check your statement syntax as needed, and resubmit the corrected program.5.Which of the following programs contains a syntax error?Correct answer:bThe DATA step contains a misspelled keyword (dat instead of data). However, this is such a common (and easily interpretable) error that SAS produces only a warning message, not an error.6.What does the following log indicate about your program?proc print data=sasuser.cargo99var origin dest cargorev;2276ERROR 22-322: Syntax error, expecting one of the following:;, (, DATA, DOUBLE, HEADING, LABEL, N, NOOBS, OBS, ROUND, ROWS, SPLIT, STYLE,UNIFORM, WIDTH.ERROR 76-322: Syntax error, statement will be ignored.11 run;a.SAS identifies a syntax error at the position of the VAR statement.b.SAS is reading VAR as an option in the PROC PRINT statement.c.SAS has stopped processing the program because of errors.d.all of the aboveCorrect answer:dBecause there is a missing semicolon at the end of the PROC PRINT statement, SAS interprets VAR as an option in PROC PRINT and finds a syntax error at that location. SAS stops processing programs when it encounters a syntax error.Chapter 4: Creating List Reports Answer Key 1.Which PROC PRINT step below creates the following output?Correct answer:cThe DATA= option specifies the data set that you are listing, and the ID statement replaces the Obs column with the specified variable. The VAR statement specifies variables and controls the order in which they appear, and the WHERE statement selects rows based on a condition. The LABEL option in the PROC PRINT statement causes the labels that are specified in the LABEL statement to be displayed.2.Which of the following PROC PRINT steps is correct if labels are not stored with thedata set?Correct aanswer:You use the DATA= option to specify the data set to be printed. The LABEL optionspecifies that variable labels appear in output instead of variable names.3.Which of the following statements selects from a data set only those observations forwhich the value of the variable Style is RANCH, SPLIT, or TWOSTORY?Correct answer:dIn 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.4.If you want to sort your data and create a temporary data set named Calc to store thesorted data, which of the following steps should you submit?Correct answer:cIn a PROC SORT step, you specify the DATA= option to specify the data set to sort. The OUT= option specifies an output data set. The required BY statement specifies the variable(s) to use in sorting the data.5.Which options are used to create the following PROC PRINT output?13:27 Monday, March 22, 1999 Patient Arterial Heart Cardiac Urinary203 88 95 66 11054 83 183 95 0664 72 111 332 12210 74 97 369 0101 80 130 291 0a.the DATE system option and the LABEL option in PROC PRINTb.the DATE and NONUMBER system options and the DOUBLE and NOOBSoptions in PROC PRINTc.the DATE and NONUMBER system options and the DOUBLE option inPROC PRINTd.the DATE and NONUMBER system options and the NOOBS option in PROCPRINTCorrect answer:bThe DATE and NONUMBER system options cause the output to appear with the date but without page numbers. In the PROC PRINT step, the DOUBLE option specifies double spacing, and the NOOBS option removes the default Obs column.6.Which of the following statements can you use in a PROC PRINT step to create thisoutput?Correct answer:dYou do not need to name the variables in a VAR statement if you specify them in the SUM statement, but you can. If you choose not to name the variables in the VAR statement as well, then the SUM statement determines the order of the variables in the output.7.What happens if you submit the following program?proc sort data=clinic.diabetes;run;proc print data=clinic.diabetes;var age height weight pulse;where sex='F';run;a.The PROC PRINT step runs successfully, printing observations in their sortedorder.b.The PROC SORT step permanently sorts the input data set.c.The PROC SORT step generates errors and stops processing, but the PROCPRINT step runs successfully, printing observations in their original (unsorted)order.d.The PROC SORT step runs successfully, but the PROC PRINT step generateserrors and stops processing.Correct answer:cThe BY statement is required in PROC SORT. Without it, the PROC SORT step fails. However, the PROC PRINT step prints the original data set as requested.8.If you submit the following program, which output does it create?proc sort data=finance.loans out=work.loans;by months amount;run;proc print data=work.loans noobs; var months;sum amount payment;where months<360;run;a.b.c.d.Correct answer:aColumn totals appear at the end of the report in the same format as the values of the variables, so b is incorrect. Work.Loans is sorted by Month and Amount, so c isincorrect. The program sums both Amount and Payment, so d is incorrect.9.Choose the statement below that selects rows which•the amount is less than or equal to $5000•the account is 101-1092 or the rate equals 0.095.Correct answer:cTo ensure that the compound expression is evaluated correctly, you can use parentheses to groupaccount='101-1092' or rate eq 0.095OBS Account Amount Rate MonthsPayment1 101-1092 $22,000 10.00%60 $467.432 101-1731 $114,0009.50% 360 $958.573 101-1289 $10,000 10.50%36 $325.024 101-3144 $3,500 10.50%12 $308.525 103-1135 $8,700 10.50%24 $403.476 103-1994 $18,500 10.00%60 $393.077 103-2335 $5,000 10.50%48 $128.028 103-3864 $87,500 9.50% 360 $735.759 103-3891 $30,000 9.75% 360 $257.75For example, from the data set above, a and b above select observations 2 and 8 (those that have a rate of 0.095); c selects no observations; and d selects observations 4 and 7 (those that have an amount less than or equal to 5000).10.What does PROC PRINT display by default?a.PROC PRINT does not create a default report; you must specify the rows andcolumns to be displayed.b.PROC PRINT displays all observations and variables in the data set. If youwant an additional column for observation numbers, you can request it.c.PROC PRINT displays columns in the following order: a column forobservation numbers, all character variables, and all numeric variables.d.PROC PRINT displays all observations and variables in the data set, a columnfor observation numbers on the far left, and variables in the order in which they occur in the data set.Correct answer:dYou can remove the column for observation numbers. You can also specify the variables you want, and you can select observations according to conditions.Chapter 5: Creating SAS Data Sets from Raw Data Answer Key1.Which SAS statement associates the fileref Crime with the raw data fileC:\States\Data\Crime?a.filename crime 'c:\states\data\crime';b.filename crime c:\states\data\crime;c.fileref crime 'c:\states\data\crime';d.filename 'c:\states\data\crime' crime; Correct aanswer:Before you can read your raw data, you must reference the raw data file by creating afileref. You assign a fileref by using a FILENAME statement in the same way thatyou assign a libref by using a LIBNAME statement.2.Filerefs remain in effect untila.you change them.b.you cancel them.c.you end your SAS session.d.all of the aboveCorrect answer:dLike LIBNAME statements, FILENAME statements are global; they remain in effect until you change them, cancel them, or end your SAS session.3.Which statement identifies the name of a raw data file to be read with the filerefProducts and specifies that the DATA step read only records 1-15?a.infile products obs 15;b.infile products obs=15;c.input products obs=15;d.input products 1-15;Correct answer:bYou use an INFILE statement to specify the raw data file to be read. You can specify a fileref or an actual filename (in quotation marks). The OBS= option in the INFILE statement enables you to process only records 1 through n.4.Which of the following programs correctly writes the observations from the data setbelow to a raw data file?Correct answer:dThe keyword _NULL_ in the DATA statement enables you to use the power of the DATA step without actually creating a SAS data set. You use the FILE and PUT statements to write out the observations from a SAS data set to a raw data file. The FILE statement specifies the raw data file and the PUT statement describes the lines towrite to the raw data file. The filename and location that are specified in the FILE statement must be enclosed in quotation marks.5.Which raw data file can be read using column input?a.b.c.d.all of the aboveCorrect answer:bColumn input is appropriate only in some situations. When you use column input, your data must be standard character or numeric values, and they must be in fixed fields. That is, values for a particular variable must be in the same location in all records.6.Which program creates the output shown below?Correct answer:aThe INPUT statement creates a variable using the name that you assign to each field. Therefore, when you write an INPUT statement, you need to specify the variable names exactly as you want them to appear in the SAS data set.7.Which statement correctly reads the fields in the following order: StockNumber,Price, Item, Finish, Style?Field Name Start Column End Column Data TypeStockNumber 1 3 characterFinish 5 9 characterStyle 11 18 characterItem 20 24 characterPrice 27 32 numericCorrec t answer:bYou can use column input to read fields in any order. You must specify the variable name to be created, identify character values with a $, and name the correct starting column and ending column for each field.8.Which statement correctly re-defines the values of the variable Income as 100percent higher?a.income=income*1.00;b.income=income+(income*2.00);c.income=income*2;d.income=*2;Correct answer:cTo re-define the values of the variable Income in an Assignment statement, you specify the variable name on the left side of the equal sign and an appropriate expression including the variable name on the right side of the equal sign.9.Which program correctly reads instream data?a.data finance.newloan;input datalines;if country='JAPAN';MonthAvg=amount/12;1998 US CARS 194324.121998 US TRUCKS 142290.301998 CANADA CARS 10483.441998 CANADA TRUCKS 93543.641998 MEXICO CARS 22500.571998 MEXICO TRUCKS 10098.881998 JAPAN CARS 15066.431998 JAPAN TRUCKS 40700.34;b.data finance.newloan;input Year 1-4 Country $ 6-11Vehicle $ 13-18 Amount 20-28;if country='JAPAN';MonthAvg=amount/12;datalines;run;c.data finance.newloan;input Year 1-4 Country 6-11Vehicle 13-18 Amount 20-28;if country='JAPAN';MonthAvg=amount/12;datalines;1998 US CARS 194324.121998 US TRUCKS 142290.301998 CANADA CARS 10483.441998 CANADA TRUCKS 93543.641998 MEXICO CARS 22500.571998 MEXICO TRUCKS 10098.881998 JAPAN CARS 15066.431998 JAPAN TRUCKS 40700.34;d.data finance.newloan;input Year 1-4 Country $ 6-11Vehicle $ 13-18 Amount 20-28;if country='JAPAN';MonthAvg=amount/12;datalines;1998 US CARS 194324.121998 US TRUCKS 142290.301998 CANADA CARS 10483.441998 CANADA TRUCKS 93543.641998 MEXICO CARS 22500.571998 MEXICO TRUCKS 10098.881998 JAPAN CARS 15066.431998 JAPAN TRUCKS 40700.34;Correct answer:dTo read instream data, you specify a DATALINES statement and data lines, followed by a null statement (single semicolon) to indicate the end of the input data. Program a contains no DATALINES statement, and the INPUT statement doesn't specify the fields to read. Program b contains no data lines, and the INPUT statement in program c doesn't specify the necessary dollar signs for the character variables Country and Vehicle.10.Which SAS statement subsets the raw data shown below so that only the observationsin which Sex (in the second field) has a value of F are processed?a.if sex=f;b.if sex=F;c.if sex='F';d. a or bCorrect answer:cTo subset data, you can use a subsetting IF statement in any DATA step to process only those observations that meet a specified condition. Because Sex is a character variable, the value F must be enclosed in quotation marks and must be in the same case as in the data set.Chapter 6: Understanding DATA Step Processing Answer Key1.Which of the following is not created during the compilation phase?。
Item 1 of 63 Mark item for reviewWhen attempting to minimize memory usage, themost efficient way to do group processing when using the MEANS procedure is to use:A.the BY statement.B.GROUPBY with the NOTSORTED specification.C.the CLASS statement.D.multiple WHERE statements.Item 2 of 63 Mark item for reviewThe SAS data set WORK.CHECK has a variablenamed Id_Code in it. Which SQL statement would create an index on this variable?A.create index Id_Code on WORK.CHECK;B.create index(Id_Code) on WORK.CHECK;C.make index=Id_Code from WORK.CHECK;D.define index(Id_Code) in WORK.CHECK;Item 3 of 63 Mark item for reviewGiven the SAS data sets:WORK.EMPLOYEE WORK.NEWEMPLOYEEName Dept Names Salary-------- ----- -------- ------Alan Sales Michelle 50000Michelle Sales Paresh 60000A SAS program is submitted andthe following is written to the SAS log:101 proc sql;102 select dept, name103 from WORK.EMPLOYEE104 where name=(select namesfrom newemployeewhere salary > 40000)ERROR: Subquery evaluated to more than one row.105 ;106 quit;What would allow the program tosuccessfully execute without errors?A.Replace the where clause with:where =(select Names delimited with ',' from WORK.NEWEMPLOYEEwhere Salary > 40000);B.Replace line 104 with:where =ANY (select Names separated with ',' from WORK.NEWEMPLOYEEwhere Salary > 40000);C.Replace the equal sign with the IN operator.D.Qualify the column names with the table names.Item 4 of 63 Mark item for reviewGiven the SAS data set SASUSER.HIGHWAY:Steering Seatbelt Speed Status Count-------- -------- ----- ------- -----absent No 0-29 serious 31absent No 0-29 not 1419absent No 30-49 serious 191absent no 30-49 not 2004absent no 50+ serious 216The following SAS program is submitted:proc sql noprint;select distinctSpeed [_insert_SQL_clause_]from SASUSER.HIGHWAY;quit;title1 "Speed values represented are: &GROUPS";proc print data=SASUSER.HIGHWAY;run;Which SQL clause stores the text 0-29,30-49,50+ in the macro variable GROUPS?A.into &GROUPSB.into :GROUPSC.into :GROUPS separated by ','D.into &GROUPS separated by ','Item 5 of 63 Mark item for reviewThe SAS data set WORK.CHECK has an indexon the variable Code and the following SASprogram is submitted.proc sort data=WORK.CHECK;by Code;run;Which describes the result of submittingthe SAS program?A.The index on Code is deleted.B.The index on Code is updated.C.The index on Code is uneffected.D.The sort does not execute.Item 6 of 63 Mark item for reviewThe table WORK.PILOTS contains the following data: WORK.PILOTSId Name Jobcode Salary--- ------ ------- ------001 Albert PT1 50000002 Brenda PT1 70000003 Carl PT1 60000004 Donna PT2 80000005 Edward PT2 90000006 Flora PT3 100000The data set was summarized to include average salary based on jobcode:Jobcode Salary Avg------- ------ -----PT1 50000 60000PT1 70000 60000PT1 60000 60000PT2 80000 85000PT2 90000 85000PT3 100000 100000Which SQL statement could NOT generatethis result?A.selectJobcode,Salary,avg(Salary) label='Avg'from WORK.PILOTSgroup by Jobcodeorder by Id;B.selectJobcode,Salary,(select avg(Salary)from WORK.PILOTS as P1where P1.Jobcode=P2.Jobcode) as Avgfrom WORK.PILOTS as P2order by Id;C.selectJobcode,Salary,(select avg(Salary)from WORK.PILOTSgroup by Jobcode) as Avgfrom WORK.PILOTSorder by Id;D.selectJobcode,Salary,AvgfromWORK.PILOTS,(selectJobcode as Jc,avg(Salary) as Avgfrom WORK.PILOTSgroup by 1)where Jobcode=Jcorder by Id;Item 7 of 63 Mark item for reviewA quick rule of thumb for the spacerequired to run PROC SORT is:A.two times the size of the SAS data set being sorted.B.three times the size of the SAS data set being sorted.C.four times the size of the SAS data set being sorted.D.five times the size of the SAS data set being sorted.Item 8 of 63 Mark item for reviewMulti-threaded processing for PROC SORT will effect which of these system resources?A.CPU time will decrease,wall clock time will decreaseB.CPU time will increase,wall clock time will decreaseC.CPU time will decrease,wall clock time will increaseD.CPU time will increase,wall clock time will increaseItem 9 of 63 Mark item for reviewGiven the SAS data set WORK.TRANSACT:Rep Cost Ship----- ----- -----SMITH 200 50SMITH 400 20JONES 100 10SMITH 600 100JONES 100 5The following output is desired:Rep----- ----JONES 105SMITH 250Which SQL statement was used?A.selectrep,min(Cost+Ship)from WORK.TRANSACTorder by Rep;B.selectRep,min(Cost,Ship) as Minfrom WORK.TRANSACT summary by Reporder by Rep;C.selectRep,min(Cost,Ship)from WORK.TRANSACTgroup by Reporder by Rep;D.selectRep,min(Cost+Ship)from WORK.TRANSACTgroup by Reporder by Rep;Item 10 of 63 Mark item for reviewThe following SAS program is submitted: %let Value=9;%let Add=5;%let Newval=%eval(&Value/&Add);%put &Newval;What is the value of the macro variable Newval when the %PUT statement executes?A.0.555B.2C.1.8D.1Item 11 of 63 Mark item for reviewThe following SAS code is submitted:data WORK.TEMP WORK.ERRORS / view=WORK.TEMP; infile RAWDATA;input Xa Xb Xc;if Xa=. then output WORK.ERRORS;else output WORK.TEMP;run;Which of the following is true ofthe WORK.ERRORS data set?A.The data set is created when theDATA step is submitted.B.The data set is created when the viewTEMP is used in another SAS step.C.The data set is not created because the DATA statement contains a syntax error.D.The descriptor portion of WORK.ERRORS is created when the DATA step is submitted.Item 12 of 63 Mark item for reviewWhich title statement would alwaysdisplay the current date?A.title "Today is: &sysdate.";B.title "Today is: &sysdate9.";C.title "Today is: &today.";D.title "Today is: %sysfunc(today(),worddate.)";Item 13 of 63 Mark item for reviewGiven the SAS data sets:WORK.ONE WORK.TWOId Name Id Salary --- ------ --- ------ 112 Smith 243 150000 243 Wei 355 45000 457 Jones 523 75000The following SAS program is submitted:data BINE;merge WORK.ONE WORK.TWO;by Id;run;Which SQL procedure statement produces the same results?A.create table BINE asselectId,Name,SalaryfromWORK.ONEfull joinWORK.TWOon ONE.Id=TWO.Id;B.create table BINE asselectcoalesce(ONE.Id, TWO.Id) as Id, Name,SalaryfromWORK.ONE,WORK.TWOwhere ONE.Id=TWO.Id;C.create table BINE ascoalesce(ONE.Id, TWO.Id) as Id, Name,SalaryfromWORK.ONEfull joinWORK.TWOon ONE.Id=TWO.Idorder by Id;D.create table BINE asselectcoalesce(ONE.Id, TWO.Id) as Id, Name,SalaryfromWORK.ONE,WORK.TWOwhere ONE.Id=TWO.Idorder by ONE.Id;Item 14 of 63 Mark item for reviewThe following SAS program is submitted:proc contents data=TESTDATA.ONE; run;Which SQL procedure step produces similar information about the column attributes of TESTDATA.ONE?A.proc sql;contents from TESTDATA.ONE;B.proc sql;describe from TESTDATA.ONE;quit;C.proc sql;contents table TESTDATA.ONE;quit;D.proc sql;describe table TESTDATA.ONE;quit;Item 15 of 63 Mark item for reviewGiven the SAS data set WORK.ONE:Rep Cost----- ----SMITH 200SMITH 400JONES 100SMITH 600JONES 100The following SAS program is submitted;proc sql;selectRep,avg(Cost)from WORK.ONEorder by Rep;quit;Which result set would be generated?A.JONES 280JONES 280SMITH 280SMITH 280SMITH 280B.JONES 600SMITH 100C.JONES 280SMITH 280D.JONES 100JONES 100SMITH 600SMITH 600SMITH 600Item 16 of 63 Mark item for reviewGiven the SAS data sets:WORK.MATH1A WORK.MATH1BName Fi Name Fi------- -- ------ --Lauren L Smith MPatel A Lauren LChang Z Patel AHillier RThe following SAS program is submitted: proc sql;select *from WORK.MATH1A[_insert_set_operator_]select *from WORK.MATH1B;quit;The following output is desired:Name Fi------- --Lauren LPatel AChang ZHillier RSmith MLauren LPatel AWhich SQL set operator completes the program and generates the desired output?A.append corrB.union corrC.outer union corrD.intersect corrItem 17 of 63 Mark item for reviewWhich of the following is anadvantage of SAS views?A.SAS views can access the most current data in files that are frequently updated.B.SAS views can avoid storing a SAS copy ofa large data file.C.SAS views can decrease programming time.D.both A and B are trueItem 18 of 63 Mark item for reviewIn what order does SAS search forformat definitions by default?A.1. WORK.FORMATS2. LIBRARY.FORMATSB.1. LIBRARY.FORMATS2. WORK.FORMATSC.There is no default order,it must be defined by the user.D.All user defined libraries that have a catalog named FORMATS, in alphabetic order.Item 19 of 63 Mark item for reviewGiven the dataset WORK.STUDENTS:Name Age------- ---Mary 15Philip 16Robert 12Ronald 15The following SAS program is submitted:%let Value=Philip;proc print data=WORK.STUDENTS;[_insert_WHERE_statement_]run;Which WHERE statement successfully completes the program and produces a report?A.where upcase(Name)=upcase(&Value);B.where upcase(Name)=%upcase(&Value);C.where upcase(Name)="upcase(&Value)";D.where upcase(Name)="%upcase(&Value)";Item 20 of 63 Mark item for reviewThe following SAS program is submitted:data WORK.TEMP;length A B 3 X;infile RAWDATA;input A B X;run;What is the length of variable A?A.3B.8C.WORK.TEMP is not created - X has an invalid length.D.Unknown.Item 21 of 63 Mark item for reviewThe following SAS program is submitted:data WORK.NEW;do i=1, 2, 3;Next=cats('March' || i );infile XYZfilevar=Nextend=Eof;do until (Eof);input Dept $ Sales;end;end;run;The purpose of the FILEVAR=option on theINFILE statement is to name the variableNext, whose value:A.points to a new input file.B.is output to the SAS data set WORK.NEW.C.is an input SAS data set reference.D.points to an aggregate storage location.Item 22 of 63 Mark item for reviewGiven the following partial SAS log:NOTE: SQL table SASHELP.CLASS was created like:create table SASHELP.CLASS( bufsize=4096 )(Name char(8),Sex char(1),Age num,Height num,Weight num);Which SQL procedure statementgenerated this output?A.CONTENTS FROM SASHELP.CLASS;B.CREATE FROM SASHELP.CLASS INTO LOG;C.DESCRIBE TABLE SASHELP.CLASS;D.VALIDATE SELECT * FROM SASHELP.CLASS;Item 23 of 63 Mark item for reviewGiven the SAS data set SASUSER.HIGHWAY:Steering Seatbelt Speed Status Count-------- -------- ----- ------- -----absent No 0-29 serious 31absent No 0-29 not 1419absent No 30-49 serious 191absent no 30-49 not 2004absent no 50+ serious 216The following SAS program is submitted:%macro SPLIT;proc sortdata=SASUSER.HIGHWAYout=WORK.UNIQUES(keep=Status)nodupkey;by Status;run;data _null_;set uniques end=Lastobs;call symputx('Status'||left(_n_),Status); if Lastobs then call symputx('Count',_n_); run;%local i;data%do i=1 %to &count;[_insert_reference_]%end;;set SASUSER.HIGHWAY;select(Status);%do i=1 %to &Count;when("[_insert_reference_]") output [_insert_reference_]; %end;otherwise;end;run;%mend;%SPLITWhat macro variable reference completesthe program to create the WORK.NOT andWORK.SERIOUS data sets?A.&Status&iB.&&Status&iC.&Status&CountD.&&Status&CountItem 24 of 63 Mark item for reviewThe following SAS program is submitted:%let Num1=7;%let Num2=3;%let Result=%eval(&Num1/&Num2);%put &Result;What is the value of the macro variable Resultwhen the %PUT statement executes?A.2.3B.2C.. (missing value)D.2.33333333333333Item 25 of 63 Mark item for reviewGiven the SAS data set SASUSER.HIGHWAY:Steering Seatbelt Speed Status Count -------- -------- ----- ------- ----- absent No 0-29 serious 31 absent No 0-29 not 1419 absent No 30-49 serious 191 absent no 30-49 not 2004 absent no 50+ serious 216The following SAS program is submitted:%macro HIGHWAY(Belt=no);proc print data=SASUSER.HIGHWAY; where Seatbelt="&Belt" ;run;%mend;%HIGHWAY(Belt=No)How many observations appear inthe generated report?A.B.2C.3D.5Item 26 of 63 Mark item for reviewGiven the following SAS data sets:WORK.VISIT1 WORK.VISIT2Id Expense Id Cost--- ------- --- ----001 500 001 300001 400 002 600003 350The following result set was summarized and consolidated using the SQL procedure:Id Cost--- ----001 300001 900002 600003 350Which of the following SQL statements was most likely used to generate this result?A.selectId,sum(Expense) label='COST'from WORK.VISIT1group by 1union allselectId,sum(Cost)from WORK.VISIT2group by 1order by 1,2;B.selectid,sum(expense) as COSTfromWORK.VISIT1(rename=(Expense=Cost)), WORK.VISIT2where VISIT1.Id=VISIT2.Idgroup by Idorder byId,Cost;C.selectVISIT1.Id,sum(Cost) as CostfromWORK.VISIT1(rename=(Expense=Cost)), WORK.VISIT2where VISIT1.Id=VISIT2.Idgroup by Idorder byId,Cost;D.selectId,sum(Expense) as Costfrom WORK.VISIT1group by Idouter union corrselectId,sum(Cost)from WORK.VISIT2group by Idorder by 1,2;Item 27 of 63 Mark item for reviewGiven the SAS data sets:WORK.FIRST WORK.SECONDCommon X Common Y ------ -- ------ -- A 10 A 1 A 13 A 3A 14B 4B 9 B 2 The following SAS program is submitted:data BINE;set WORK.FIRST;set WORK.SECOND;run;What data values are stored in data set BINE?A.Common X Y------ -- --A 10 1A 13 3B 14 4B 9 2B.Common X Y------ -- --A 10 1A 13 3A 14 3B 9 4B 9 2C.Common X Y------ -- --A 10 1A 13 3A 14 .B 9 4B . 2D.Common X Y------ -- --A 10 1A 13 1A 14 1A 10 3A 13 3A 14 3B 9 4B 9 2Item 28 of 63 Mark item for reviewWhich of the following ARRAY statements is similar to the statement array Yr{1974:2007} Yr1974-Yr2007; and will compile without errors?A.array Yr{34} Yr1974-Yr2007;B.array Yr{74:07} Yr1974-Yr2007;C.array Yr{74-07} Yr1974-Yr2007;D.array Yr{1974-2007} Yr1974-Yr2007;Item 29 of 63 Mark item for reviewThe following program is submitted to checkthe variables Xa, Xb, and Xc in the SASUSER.LOOK data set:data _null_ WORK.BAD_DATA / view=WORK.BAD_DATA ; set SASUSER.LOOK(keep=Xa Xb Xc);length _Check_ $ 10 ;if Xa=. then _check_=trim(_Check_)!!" Xa" ;if Xb=. then _check_=trim(_Check_)!!" Xb" ;if Xc=. then _check_=trim(_Check_)!!" Xc" ;put Xa= Xb= Xc= _check_= ;run ;When is the PUT statement executed?A.when the code is submittedB.only when the WORK.BAD_DATA view is usedC.both when the code is submitted and the view is usedD.never, the use of _null_ in a view is a syntax errorItem 30 of 63 Mark item for reviewThe following SAS program is submitted:%let product=merchandise;[_insert_%put_statement_]and the following message is written to the SAS log:the value is "merchandise"Which macro statement wrote this message?A.%put the value is '"'&product.'"';B.%put the value is %quote(&product.);C.%put the value is "&product.";D.%put the value is ""&product."";Item 31 of 63 Mark item for reviewGiven the SAS data sets:WORK.ONE WORK.TWOX Y SumY-- -- ----A 10 36A 3A 14B 9The following SAS DATA step is submitted:data BINE;if _n_=1 then set WORK.TWO;set WORK.ONE;run;What data values are stored in data set BINE?A.An ERROR message is written to the SAS log andthe data set BINE is not created.B.SumY X Y---- -- --36 A 10C.SumY X Y---- -- --36 A 10. A 3. A 14. B 9D.SumY X Y---- -- --36 A 1036 A 336 A 1436 B 9Item 32 of 63 Mark item for reviewThe following SAS program is submitted:data WORK.NEW(bufno=4);set WORK.OLD(bufno=3);run;Why are the BUFNO options used?A.to reduce memory usageB.to reduce CPU time usageC.to reduce the amount of data readD.to reduce the number of I/O operationsItem 33 of 63 Mark item for reviewGiven the following programand desired results:%let Thing1=gift;%let Thing2=surprise;%let Gift1=book;%let Gift2=jewelry;%let Surprise1=dinner;%let Surprise2=movie;%let Pick=2;%let Choice=surprise;Desired %PUT Results in LOG:My favorite surprise is a movieWhat is the correct %PUT statementthat generates the desired results?A.%put My favorite &Thing&Pick is a &&Choice&Pick;B.%put My favorite &&Thing&pick is a &&&Choice&Pick;C.%put My favorite &Choice&pick is a &&Thing&Pick;D.%put My favorite &&Choice&pick is a &&&Thing&Pick;Item 34 of 63 Mark item for reviewGiven the SAS dataset WORK.ONEName Salary----- ------Hans 200Maria 205Jose 310Ariel 523The following SAS program is submitted:proc sql;[_insert_select_clause_]from WORK.ONE;quit;The following output is desired:Salary Bonus------ -----200 20205 20.5310 31523 52.3Which SQL procedure clause completesthe program and generates the desired output?A.select Salary Bonus as Salary*.10 as BonusB.select Salary Bonus=Salary*.10 'Bonus'C.select Salary, Salary*.10 label='Bonus'D.select Salary, Salary*.10 column="Bonus"Item 35 of 63 Mark item for reviewThe following SAS program is submitted:options reuse=YES;data SASUSER.REALESTATE(compress=CHAR);set SASUSER.HOUSES;run;What is the effect ofthe reuse=YES SAS system option?A.It allows updates in place.B.It tracks and recycles free space.C.It allows a permanently stored SASdata set to be replaced.D.It allows users to access the sameSAS data set concurrently.Item 36 of 63 Mark item for reviewWhich statement is true for Data step HASH objects?A.The key component must be numeric.B.The data component may consist of numericand character values.C.The HASH object is created in one step andreferenced in another.D.The HASH object must be smaller than 2 tothe 8th power bytes.Item 37 of 63 Mark item for reviewGiven the SAS data sets:WORK.CLASS1 WORK.CLASS2Name Course Name Class------ ------ ------- -----Lauren MATH1 Smith MATH2Patel MATH1 Farmer MATH2Chang MATH1 Patel MATH2Chang MATH3 Hillier MATH2The following SAS program is submitted:proc sql;select Namefrom WORK.CLASS1[_insert_set_operator_]select Namefrom WORK.CLASS2;quit;The following output is desired:Name------ChangChangLaurenWhich SQL set operator completes the program and generates the desired output?A.intersect corrB.except allC.intersect allD.left exceptItem 38 of 63 Mark item for reviewThe following SAS program is submitted:%macro CHECK(Num=4);%let Result=%eval(&Num gt 5); %put Result is &result;%mend;%check(Num=10)What is written to the SAS log?A.Result is 0B.Result is 1C.Result is 10 gt 5D.Result is trueItem 39 of 63 Mark item for reviewThe following SAS program is submitted:%let Mv=shoes;%macro PRODUCT(Mv=bicycles);%let Mv=clothes;%mend;%PRODUCT(Mv=tents)%put Mv is &Mv;What is written to the SAS log?A.Mv is bicyclesB.Mv is clothesC.Mv is shoesD.Mv is tentsItem 40 of 63 Mark item for reviewWhich of the following SAS Systemoptions can aid in benchmarking?A.BUFSIZE= and BUFNO=B.FULLSTIMERC.IOBLOCKSIZE=D.SYSTIMERItem 41 of 63 Mark item for reviewGiven the following macro program:%macro MAKEPGM(NEWNAME, SETNAME, PRINT); data &NEWNAME;set &SETNAME;run;%if &PRINT=YES %then %do;proc print data=&NEWNAME.(obs=10); run ;%end;%mend;Which option would provide feedback in the log about the parameter values passed into this macro when invoked?A.MPRINTB.MDEBUGC.MLOGICD.MPARAMItem 42 of 63 Mark item for reviewThe NOTSORTED option on the BY statement cannot be used with which other statement or option?A.SETB.MERGEC.IF FIRST.by-variableD.BY GROUPFORMAT by-variableItem 43 of 63 Mark item for reviewGiven the SAS data set WORK.ONE:Rep Cost----- ----SMITH 200SMITH 400JONES 100SMITH 600JONES 100The following SAS program is submitted:proc sql;selectRep,avg(Cost) as Averagefrom WORK.ONE[either__insert_SQL_where_clause_]group by Rep[_or_ _insert_SQL_having_clause_];quit;The following output is desired:Rep Average----- -------SMITH 400Which SQL clause completes the programand generates the desired output?A.where calculated Average > (select avg(Cost) from WORK.ONE) B.having Average > (select avg(Cost) from WORK.ONE)C.having avg(Cost) < (select avg(Cost) from WORK.ONE)D.where avg(Cost) > (select avg(Cost) from WORK.ONE)Item 44 of 63 Mark item for reviewWhich dictionary table providesinformation on each occurrence ofthe variable named LastName?A.DICTIONARY.TABLESB.DICTIONARY.COLUMNSC.DICTIONARY.MEMBERSD.DICTIONARY.VARIABLESItem 45 of 63 Mark item for reviewTo create a list of unique Customer_Idvalues from the customer data set, whichof the following techniques can be used?technique 1: proc SORT with NODUPKEY and OUT=technique 2: data step with IF FIRST.Customer_Id=1technique 3: proc SQL with the SELECT DISTINCT statementA.only technique 1B.techniques 1 and 2C.techniques 1 and 3D.techniques 1, 2, or 3Item 46 of 63 Mark item for reviewGiven the SAS data sets:WORK.CLASS1 WORK.CLASS2Name Course Name Class ------ ------ ------ ----- Lauren MATH1 Smith MATH2 Patel MATH1 Farmer MATH2 Chang MATH1 Patel MATH2 Hillier MATH2The following SAS program is submitted:proc sql;select Namefrom WORK.CLASS1[_insert_set_operator_]select Namefrom WORK.CLASS2;quit;The following output is desired: Name------ChangLaurenWhich SQL set operator completes the program and generates the desired output?A.intersect corrB.exceptC.intersectD.left exceptItem 47 of 63 Mark item for reviewThe following SAS program is submitted:%macro execute;[_insert_statement_here_]proc print data=SASUSER.HOUSES;run;%end;%mend execute;%executeWhich statement completes the program sothat the PROC PRINT step executes on Thursday?A.if &sysday = Thursday then %do;B.%if &sysday = Thursday %then %do;C.%if "&sysday" = Thursday %then %do;D.%if &sysday = "Thursday" %then %do;Item 48 of 63 Mark item for reviewGiven the following program and data:data WORK.BDAYINFO;infile datalines;input Name $ Birthday : mmddyy10.;datalines;Alan 11/15/1950Barb 08/23/1966Carl 09/01/1963;run;%let Want=23AUG1966;proc print data=WORK.BDAYINFO;[_insert_statement_]run;What is the WHERE statement that successfully completes the PROC PRINT and selects the observation for Barb?A.where Birthday=&Want;B.where Birthday="&Want";C.where Birthday="&Want"d;D.where Birthday='&Want'd;Item 49 of 63 Mark item for reviewWhich macro statement would remove the macrovariable Mv_Info from the symbol table?A.%mdelete &Mv_Info;B.%symerase Mv_Info;C.%symdel &Mv_Info;D.%symdel Mv_Info;Item 50 of 63 Mark item for reviewThe table WORK.PILOTS contains the following data:Id Name Jobcode Salary--- ------ ------- ------001 Albert PT1 50000002 Brenda PT1 70000003 Carl PT1 60000004 Donna PT2 80000005 Edward PT2 90000006 Flora PT3 100000A query was constructed to display the pilot salary means at each level of Jobcode and the difference tothe overall mean salary:Jobcode Average Difference------------------------------PT1 60000 -15000PT2 85000 10000PT3 100000 25000Which select statement could NOT haveproduced this output?A.selectJobcode,avg(Salary) as Average,calculated Average - Overall as differencefromWORK.PILOTS,(select avg(Salary) as Overall from WORK.PILOTS)group by jobcode;B.selectJobcode,avg(Salary) as Average,(select avg(Salary) from WORK.PILOTS) as Overall, calculated Average - Overall as Differencefrom WORK.PILOTSgroup by 1;C.selectJobcode,Average,Average-Overall as Differencefrom(select Jobcode, avg(Salary) as Averagefrom WORK.PILOTSgroup by 1),(select avg(Salary) as Overallfrom WORK.PILOTS);D.selectJobcode,avg(Salary) as Average,calculated Average-(select avg(Salary) from WORK.PILOTS) as Differencefrom WORK.PILOTSgroup by 1;Item 51 of 63 Mark item for reviewThe SAS data set WORK.TEMP is indexedon the variable Id:Id Amount-- ------P 52P 45A 13A 56R 34R 12R 78The following SAS program is submitted:proc print data=WORK.TEMP;[_insert_BY_statement_]run;Which BY statement completes the program,creates a listing report that is groupedby Id, and completes without errors?A.by Id;。
Heterogeneity and the FDI versus Export Decision of Japanese Manufacturers∗Keith Head†John Ries‡October28,2003We investigate whether productivity differences explain why some manufacturers sell only to the domestic market while others serve foreign markets through exports and/or FDI.When overseas production offers no cost advantages,our model predicts that investors should be more productive than exporters.An extension allowing for low-cost foreign production can reverse this prediction.Data for1070large Japanese firms reveal thatfirms that invest abroad and export are more productive thanfirms that just export.Among overseas investors,more productivefirms span a wider range of host-country income levels.JEL classification:F120,F230Keywords:FDI,exports,productivity,heterogeneousfirms∗We thank Kyoji Fukao,Jota Ishikawa,an anonymous referee,and participants at the15th Annual TRIO Conference held in Tokyo,December10–11,2002for their helpful comments.†Sauder School of Business,University of British Columbia,2053Main Mall,Vancouver,BC,V6T1Z2, Canada.Tel:(604)822-8492,Fax:(604)822-8477,Email:keith.head@ubc.ca‡Sauder School of Business,University of British Columbia,2053Main Mall,Vancouver,BC,V6T1Z2, Canada.Tel:(604)822-8493Email:john.ries@ubc.ca1IntroductionTheoretical and empirical research has revealed the factors that underlie the decision of firms to serve foreign consumers through foreign direct investment(FDI)or exporting. Evidence shows thatfirms prefer FDI to exporting when trade costs are high and plant-level scale economies are low.In any given industry,however,we observe that some firms engage in FDI,some export,and some do neither.There is limited understanding of heterogeneous actions offirms facing the same trade and investment opportunities.This paper builds on research of Helpman,Melitz,and Yeaple(forthcoming),here-after HMY,examining the role of differences in the productivity levels offirms in an industry as explanations for the presence of purely domesticfirms,exportingfirms,and investingfirms.We develop an alternative model that yields the predictions found by HMY and then test these predictions.We also extend the model and show that the order-ing predicted by HMY can be reversed if the foreign country is the low-cost production site.We categorize1070publicly traded Japanesefirms in1989into groups according to whether they export and have foreign direct investment.Then we use various measures of the productivity of thesefirms to investigate productivity differences across these groups.Our analysis contributes to the literature investigating the export versus FDI decision offirms.Brainard(1997)shows how trade costs,market size,and plant-level economies of scale interact to explain the export and FDI decision offirms producing differentiated products.She shows that the share offirms that export in an industry is an increasing function of scale economies and a decreasing function of trade costs and foreign market ing U.S.exports and foreign affiliate sales data for63industries in27countries,Brainardfinds that export shares decrease with trade and freight costs and increase with plant-level scale economies.Brainard identifies a possible equilibrium where somefirms export and others do foreign investment.Her theory,however,simply specifies the share offirms doing each activity and does not predict whichfirms do which activity.HMY extend this line of research by identifying a role for productivity differences to explain the choice.HMY develop a free entry model wherefirms have heterogeneous productivity levels and each produce a differentiated product.Consumers have CES preferences and goods are subject to“iceberg”transportation costs.Theyfind that the least productivefirms do not serve the foreign market,the most productivefirms engage in FDI,and the mid-rangefirms export.Their paper extends Melitz(forthcoming)that shows that only the most productivefirms in an industry export.Bernard,Eaton,Jenson,and Kortum(2003) use a Ricardian model of trade in differentiated products and demonstrate that the most productivefirms in an industry export.Neither of the latter papers consider the option to reach foreign consumers through direct investment.Bernard and Jenson(1999)measure the total factor productivity(TFP)of U.S.man-ufacturing plants over the period1984–1992.Theyfind that exporting plants exhibit higher TFP than non-exporters(after controlling for industry and statefixed effects) and productive plants are most likely to become exporters.Bernard and Jenson also investigate whether exporting“causes”greater TFP by examining productivity growth of exporters and non-exporters.Their results showing that exporters have significantly slower TFP growth than non-exporters do not support the proposition that exporting generates TFP growth.HMY analyze the relationship between the export to FDI ratioof4-digit U.S.manufacturing industries and the dispersion of sales levels in these indus-tries andfind support for their model.Girma and Kneller(2003)test the predictions of HMY using data on5,332firms in the United Kingdom.Based on tests of stochastic dominance,theyfind support for the proposition that the productivity distribution of multinationals dominates that of exportfirms which dominates that of non-exporters.We extend both the theoretical and empirical literature.The next section develops a simple linear demand model that generates the HMY predictions under the assumption that factors prices are equal and thatfirms serve foreign consumers either by exporting or opening up a new manufacturing facility in the foreign country.Section3explains how we classify the1070Japanese manufacturingfirms into four groups and identifies the different ways we measure productivity.It goes on to examine differences in produc-tivity across the groups offirms to test the predictions of our model in the case of equal wages.Section4considers international factor price differences and the possibility that firms may choose to close down the home plant when they invest abroad.Wefind that low productivityfirms are the ones most attracted to the option of relocating to a low-cost foreign country.Data on host-country incomes reveal that low productivityfirms invest primarily in low-income countries.Thefinal section summarizes ourfindings.2Theoretical Predictions of the Basic ModelWe provide a simple theoretical model that generates predictions that can be tested with our data.It replicate’s HMY’s predictions on the ordering of productivity acrossfirms that sell only to the domestic market and those that serve foreign markets through ex-ports and/or FDI.Our analysis,therefore,reveals that their theoretical results do not rely upon their assumptions of CES preferences and iceberg transportation costs.We evaluatefirm i producing a differentiated product that is deciding whether to serve a foreign market f and,if so,whether to export or invest abroad(FDI).A third way to serve the foreign market would be to license the production process or brand to a foreignfirm.Firm-level data on licensing by Japanesefirms are not available.Aggre-gate Japanese data suggest that exporting and direct investment are the primary modes through which Japanesefirms serve foreign markets:For2001,the Bank of Japan re-ports exports of46.6trillion yen,a stock of direct investment abroad of39.6trillion yen, and total royalties and license fees of just1.3trillion yen.For these reasons,we do not consider the possibility of licensing in the ensuing analysis.We assume that marginal costs are constant and equal to w/A i where w represents wages in the country where the goods are produced and A i is a measure of productivity that is specific tofirm i and varies acrossfirms.Thefirm evaluates the profits of export-ing and foreign investment and chooses the mode that generates the highest profits.We assume the following quadratic utility function for consumers:U=Q0+Ni=1[Q i−(1/2)Q2i].Products i=1...N are each manufactured by a singlefirm whereas Q0is a competi-tively supplied numeraire good.Utility maximization yields a linear demand forfirm i’s product:P i=1−Q i,for i≥1.Thus,this set-up allows us to model eachfirm’s deci-sion as if it were a monopolist facing a linear demand curve.We therefore omit thefirmsubscripts in the rest of the derivation.Obviously these assumptions are not designed for realism but rather to examine the FDI versus export decision in a truly“minimal”model of the market.Exports incur a per unit trade cost ofτwhereas FDI allows thefirm to avoid trade costs but requires afixed cost K to operate the facility.As this model is static,K com-prises reoccurring expenses that do not vary with output as well as sunk costs incurred when the plant is opened.If afirm chooses to neither export nor do FDI it earns zero profits in the foreign market.We assume equal wages of w in the home and foreign country,an assumption that yields the same result as HMY regarding the ordering of productivity across types offirms.With equal wages,the profits from exporting,πX,and FDI,πI,are given byπX=[(1−(w/A)−τ)/2]2,πI=[(1−(w/A))/2]2−K.Figure1displays the profits associated with each choice for different levels of A.1 Unproductivefirms,those with low realizations of A,neither export nor engage in FDI because they cannot sell for a price lower than the“choke”price or afford thefixed costs of FDI.Thefigure also shows that highly productivefirms prefer FDI to exports.Figure1shows the critical level of A that makes each mode preferable.The critical 1We generate thefigure based on parameter values ofτ=.15,w=.5,and K=.05.Figure 1:Productivity and the profits of exporting (ΠX )and FDI (ΠI )Productivity (A)P r o f i t 0A XA I A ~I xΠXy ΠIz −K −1.15K productivity levels for exporting,A X ,and FDI,A I ,areA X =w/(1−τ)and A I =w2τ2τ−4K −τ2 .The equalities reveal a few intuitive comparative statics.First,rising trade costs increase the critical productivity required to make exporting profitable.Second,higher trade costs lower the critical productivity necessary to make FDI preferred to exporting.2Fi-nally,a higher fixed cost of operating foreign affiliates increases the level of productivity necessary for FDI to be more profitable than exporting.The model outlined above considers a single foreign market.However,firms have 2This comparative static requires that K −τ2>0which is always met if exporting is the most profitable strategy for some level of productivity.the opportunity to sell to consumers in different foreign countries.Our data set does not contain information on the destination of eachfirm’s exports.Thus,we are interested in aggregate exports and FDI.Fixed costs of investment vary across destination coun-tries for a number of reasons.Countries with high crime rates and political rebellions increase security costs.Markets where corruption is rife might also require bribes.Fixed costs could reflect expatriate staffing necessary to implement modern management tech-niques.In distant and unfamiliar markets,substantial costs might also be required to gather intelligence and identify optimal production sites.The dashed line in Figure1shows the profits associated with FDI whenfixed costs are increased and portrays how a higher critical level of productivity,denoted˜A I,is nec-essary to make FDI preferable.Considerfirms with productivity levels corresponding to points x,y,and z.Firm x exports to both markets,Firm y exports to the highfixed-cost country and invests in the other country,and Firm z invests in both foreign countries. Aggregating across markets will yield manyfirms that do both FDI and exporting.Our simple model generates the same testable prediction that HMY generate in their ly,firms that serve only the domestic market,firms that export,firms that export and do FDI,andfirms that serve foreign consumers only through FDI are ordered according to their productivity levels.3Testing the Model PredictionsThefirst subsection describes the data and the proxies we use forfirm productivity.The second subsection tests the predictions of the basic model.3.1Data and productivity measuresWe employ data for1070publicly listed Japanese manufacturingfirms.Exports,sales,finished goods purchases,material purchases,depreciable assets,and labour costs are available from thefinancial statements of publicly traded companies in Japan.Thefirms are classified into172-digit industries and885-digit industries(the appendix contains a list of these industries).Toyo Keizai(1992)compiles information on the overseas af-filiates of Japanese companies based on a survey conducted in1991.They list the host country,number of employees,date of establishment,equity share,and type of invest-ment(greenfield or acquisition).We classify thesefirms into four groups based on1989characteristics.We use D to representfirms that only serve the domestic market.DX alsofirms export,DXIfirms export and invest abroad,and DIfirms have FDI but do not export.Table1provides information on these groups.The largest group is DXI with459firms accounting for 80%of the domestic employment of the1070firms.The next largest group is thefirms that export but do not do FDI.There are morefirms that sell only to the domestic market than those that sell to the domestic market and have overseas affiliates but the latter group comprises largerfirms.The table reveals that Dfirms are the smallest in terms of average sales,average value added,and average employment whereas DXIfirms are the largest.DX and DIfirms lie in between in terms of size with DI being somewhat larger of the two.Our theory predicts that there will be an ordering of our four groups according to ly,Dfirms should be the least productive,followed by DXfirms, then DXIfirms,with DIfirms being the most productive.To test this prediction,weTable1:Characteristics byfirm typeType Firms Sales VA Emps.Emps.#Avg.(m.Y)Avg.(m.Y)Avg.Share Domestic sales only(D)19236490144286274% Dom.sales and exports,(DX)375435891948988012% Dom.sales,exports,and FDI(DXI)459250690108319465980% Dom.sales and FDI(DI)441344935540322764% must measurefirm-level productivity.Our model,as well as that of HMY,predicts a monotonic relationship betweenfirm output and productivity.This is because produc-tivefirms have lower unit costs,charge lower prices,and therefore sell more.Since the monopolist always prices in the elastic proportion of the demand curve,the value of sales will increase with productivity.Accordingly,we use sales as well as two other measures offirm size—value added and employment—as proxies for productivity.We calculate value added as the difference between sales and the sum offinished goods and materials purchases.We also subtract exports from sales and value added to avoid “accounting”relationships between these measures andfirm types DX and DXI that re-flect export activities.Thus,these measures indicate size in the domestic market.3We cannot,however,adjust employment and thus it reflects employment for both domestic and export sales.We also estimate productivity three ways by utilizingfirm-level information on out-put and factor inputs.Following Griliches and Mairesse(1990)we measure“approxi-3There are64cases where subtracting exports from value-added generates negative numbers.These arefirms that purchasefinished goods that they sell abroad.To see this,consider afirm that only purchases finished goods for export.Calculating value added as sales-(exports+finished goods)yields a negative number.mate total factor productivity”as:ATFP≡ln Q/L−s ln K/L.Intuitively,this productivity measure starts with average labor productivity,Q/L,and adjusts for capital intensity K/L.Parameter s measures the importance of capital in the production function and can vary between zero,where productivity equals labor productivity,and one,where productivity is given by capital productivity(Q/K).In the empirical implementation we follow Hall and Jones(1999)in setting s=1/3.The drawback to ATFP is that it reflects both“true”technical efficiency as well as scale economies.To see this,consider a Cobb-Douglas production function given by Q=A[KωL(1−ω)]µ.We can relate our measure of productivity,ATFP,to the true technical efficiency parameter,denoted A,ATFP=ln A+(µω−s)ln K+(µ(1−ω)−(1−s))ln L.Technical efficiency equals ATFP whenµω=s andµ(1−ω)=1−s.This occurs when there are constant returns to scale(µ=1)and s equals the true capital cost share,ω.Substituting the cost minimization condition s=ωand manipulating,we arrive atATFP=(1/µ)ln A+µ−1µln Q.The productivity measure ATFP varies with true technical efficiency and scale.Thetheory pertains to technical efficiency.Firms with high technical efficiency will export or invest abroad.Exporting will increase the scale of home operations whereas FDI might lower it if it displaces production for export.ATFP will be a good measure of technical efficiency if there are constant returns to scale and s=1/3is a reasonable measure of the cost share of capital.We also measure productivity by estimating the following four-factor Cobb-Douglas production functionln Q it=ln A t+βM ln M it+βK ln K it+βS ln S it+βU ln U it+ it.where Q is a measure of output and M,K,S,and U,represent materials,capital,skilled workers,and unskilled workers.Output is sales minus purchasedfinished goods.We measure capital as the stock of depreciable assets(buildings,machinery,and equipment).To allow for heterogeneity across workers in afirm,we consider two types of labour inputs—production(termed unskilled,U)and nonproduction workers(termed skilled,S).We have data on total compensation paid to each category of employees.We deflate production wages by the average wage paid to workers with high school degrees in Japan to obtain a measure of production worker inputs.Similarly,to measure nonproduction worker inputs,we deflate total salaries of selling,general and administrative(SGA)employees by the av-erage salary paid to university graduates.We deflate nominal output by the wholesale price index.Price indices are available at roughly the2-digit industry level.We de-flate depreciable assets by the Japanese capital goods deflator.To deflate materials,weTable2:Industry-level(2-digit)production function estimates Industry#Firms Scale economies(µ)Capital share(ω)Food92 1.010.53Textile780.960.22Pulp and paper31 1.010.26Chemicals1330.980.48Pharmaceuticals340.970.32Petroleum10 1.140.39Rubber20 1.010.08Glass and cement570.990.40Steel590.990.21Non-ferrous metals890.980.09Machinery1580.980.20Electrical machinery153 1.000.36Shipbuilding10 1.030.15Automobile53 1.020.32Other transportation180.990.28Precision machinery30 1.030.27Other manufacturing40 1.050.36use price level for goods in the corresponding industry since most industries purchase substantial quantities of inputs from their own industry.We estimate the production function using data for1977to1989(the longest period for which data are available for the1070firms)and measure productivity as the1989 regression residual associated with eachfirm.We calculate two sets of residuals—RES5 and RES2—based on whether we estimate the factor coefficients at the5-digit or2-digit level.The former method provides more degrees of freedom whereas the latter allows more variation in the estimated factor shares.4We have the data to compute values of RES5and RES2for1060firms in1989.Table2provides information from the production function regressions where the factor elasticities vary across2-digit industries.We show the industry name,number of 4Each2-digit industry contains at least tenfirms whereas215-digit industries havefivefirms or fewer.firms,the returns to scale(µ=βM+βK+βS+βU),and capital’s implied share of primary input costs(ω=βK/(βK+βS+βU).The data reveal that constant returns to scale is not a bad assumption asµranges from0.96to1.14and only one industry(petroleum,10firms)has aµthat is more than0.05away from one.We note that simultaneity is likely to cause upward bias in estimates of factor shares so these values might be interpreted as upper limits.Petroleum exhibits the highest returns to scale and Textiles the least. The average implied capital share of primary inputs is.29with11out of17industries having shares between.20and.39.There is more variation exhibited when we estimate the factor shares at the5-digit industry level,a result partly due less precise estimates. In these regressions,one industry hasµ=.76whereas it is between.88and1.18for the remaining87industries.Capital’s share of primary inputs has a mean of.33(coinciden-tally equal to the value we used for ATFP)but a large standard deviation(.25)once we remove one2-firm industry with a capital share of-6.3.5We are not sure whether to take comfort in what Table2reveals about the estimates of the parameters of the industry production functions.Accounting data do not neces-sarily correspond well to the underlying economic variables in theoretical production functions and we must resort to use of book values of capital stocks instead of(usually unmeasurable)flows of capital services.This may result in inaccurate estimates.On the positive side,the results of roughly constant returns to scale and capital shares av-eraging around one-third appear plausible and indicate that ATFP may be a reasonable approximation.5While there are no estimated negative factor shares when the coefficients vary at the2-digit level, negative estimates do occasionally arise for5-digit industry regressions.None of the negative estimates are statistically significant when we compute standard errors that allow for correlated errors at thefirm level.Pavcnik(2002)deals with the endogeneity of input choices using a method due to Pakes and Olley(1995).Her method also treats potential biases due to non-random selection of thefirm-level sample.This multi-step method uses polynomial approxima-tions to back out innovations in productivity from thefirm’s investment decisions.Our concern here is not with production function estimation per se but rather with obtain-ing a measure of productivity that allows us to orderfirms in an industry.We believe that standard productivity estimation techniques are adequate for this purpose.In the analysis that follows,we subtract the industry mean level of productivity fromfirm pro-ductivity,a procedure that will alleviate some sources of potential bias in our estimates. We believe the principle shortcoming of our productivity estimates derives from the data and cannot be greatly reduced by more complex econometric methods that appear to make strong identifying assumptions.6Table3:Pairwise correlations between productivity measuresATFP RES5RES2Ln sales Ln VARES50.65RES20.710.84Ln domestic sales0.270.140.14Ln domestic VA0.360.240.230.90Ln employment0.100.050.050.920.88Note:RES5and RES2are residuals from production functionestimates for5-and2-digit industries over the period1977–1989.“Domestic”sales and VA exclude export sales.All vari-ables expressed as deviations from5-digit industry averages.Table3displays the correlations of the productivity measures.The size measures—sales,value added,and employment—are logged and all variables are expressed as dif-6See discussion in Syverson(2001).ferences from the relevant5-digit industry average.7Thus,they reflect productivity differences within individual industries.The table reveals that all the measures are pos-itively correlated.The“size”variables are highly correlated as one may expect.The productivity measures are highly correlated with each other(ρ’s between.65and.84) but not highly correlated with the size measures.These low correlations(0.05–0.27) do not square well with the model of HMY or with the general prediction that market equilibrium should give higher market shares to more efficientfirms.One possible ex-planation is thatfirms in the same industry with very different measured productivities may actually be producing goods that are not close substitutes for each other.Even our 5-digit industries(shown in appendix)often aggregate over diverse sets of products.In the following section,we see how the different measures of productivity vary across our groupings offirms.3.2ResultsAn important conceptual issue for the empirical analysis is how to utilize information for885-digit industries.The theory outlined previously considers a single industry where eachfirm in the industry potentially sells into a number of foreign countries. The most productivefirms do FDI,the least productivefirms do not serve foreign con-sumers,and intermediate productivityfirms export.One problem is that productivity measures are not commensurate across industries. Monetary output measures and corresponding productivity residuals depend on the 7The residuals calculated using5-digit factor share coefficients have zero means within5-digit in-dustries because we include a constant.All other measures have non-zero industry means prior to our “demeaning”procedure.price or unit of measurement of the industry.Employment may vary systematically across industries as a result of differences in minimum efficient scale.Some type of nor-malization is necessary before we can aggregate the information across the industries. Our technique is to subtract of the industry mean for each5-digit industry so that pro-ductivity is represented as a difference from the industry average.This procedure forces each industry to have the same mean productivity(zero).A second problem results from the limited number offirms in some industries in-dustry.The number offirms ranges from two to46.The appendix shows the types of firms in each industry and reveals that only15industries havefirms of each type(D, DX,DXI,DI).Seven industries only havefirms of a single type whereas the rest have two or three types.To see what issues this heterogeneity raises,consider thefictitious data contained in Table4.Each cell corresponds to the average,demeaned productivity level offirms of the specified type in the specified industry.Assuming the same number offirms in each cell,average productivity in each industry is zero(as can be seen by summing down each column).The example follows the productivity ordering predicted by the theory. Averagingfirm types across industries as shown in the last column illustrates two prob-lems.First,including industry1will bias the DXI average towards zero.Second,the pooling of industries causes DXI average productivity to exceed that of DIfirms in this example.In light of these issues,we evaluate the theoretical predictions in two ways.Ourfirst method is to average productivity across industries with the same set offirm types.We separately examine the24industries with DX and DXIfirms,the27industries with D,Table4:Aggregation issuesIndustry123456Avg.D-7-10-9-1-6.75DX-13422DXI01463 2.8DI41 2.5DX,DXIfirms,and the15industries with D,DX,DXI,and DIfirms.Our second method is to code an orderedfirm type variable and regress it on productivity measures.We as-sign D,DX,DXI,and DIfirms the values1,2,3,and4.Heterogeneity in industry charac-teristics(fixed costs,trade costs,etc.)imply different relationships between productivity andfirm type for each industry.We therefore estimate the regressions individually for each5-digit industry.Table5lists the mean characteristics offirms of each type for the three sets of in-dustries.Recall the theory predicts a productivity ordering of D,DX,DXI,DI.Thefirst column shows the number offirms of each type.The next three columns display means for the size proxies for productivity and the last three columns display means for the TFP variables.Recall that all the productivity measures are expressed as deviations from the 5-digit industry mean.The asterisks(∗)identify cases where the mean for D,DXI,and DIfirms differs significantly from that of DXfirms(5%level).The means of the size variables across types strongly support the theory.Dfirms are19%to33%smaller than DXfirms whereas DXIfirms are105%to332%larger than their DX counterparts.Moreover the differences between DXI and DXfirms are statis-tically significant in each of the three sets of industries.One exception to the theory’s。
EXPORT STRATEGYASSESSING A PRODUCT'S EXPORT POTENTIALThere are several ways to gauge the overseas market potential of products and services. (For ease of reading, products are mentioned more than services in this guide, but much ofthe discussion applies to both.) One of the most important ways is to assess the product's success in domestic markets. If a company succeeds at selling in a domestic market, thereis a good chance that it will also be successful in markets abroad, wherever similar needs and conditions exist.In markets that differ significantly from the domestic market, some products may have limited potential. Those differences may be climate and environmental factors, social and cultural factors, local availability of raw materials or product alternatives, lower wage costs, lower purchasing power, the availability of foreign exchange (hard currencies like the dollar, the British pound, and the Japanese yen), government import controls, and many other factors.If a product is successful in a domestic market, one strategy for export success may be a careful analysis of why it sells here, followed by a selection of similar markets abroad. Inthis way, little or no product modification is required.If a product is not new or unique, low-cost market research may already be available to help assess its overseas market potential. In addition, international trade statistics (available in many local libraries) can give a preliminary indication of overseas markets for a particular product by showing where similar or related products are already being sold in significant quantities.If a product is unique or has important features that are hard to duplicate abroad, chances are good for finding an export market. For a unique product, competition may be nonexistent or very slight, while demand may be quite high.Finally, even if domestic sales of a product are now declining, sizeable export markets may exist, especially if the product once did well in the United States but is now losing marketshare to more technically advanced products. Countries that are less developed than the United States may not need state-of-the-art technology and may be unable to afford the most sophisticated and expensive products. Such markets may instead have a surprisingly healthy demand for products that are older or that are considered obsolete by market standards.MAKING THE EXPORT DECISIONOnce a company determines it has exportable products, it must still consider other factors, such as the following:• What does the company want to gain from exporting?• Is exporting consistent with other company goals?• What demands will exporting place on the company's key resources - management and personnel, production capacity, and finance - and how will these demands be met?• Are the expected benefits worth the costs, or would company resources be better used for developing new domestic business?Answers to these questions can help a company not only decide whether or not to export but also determine what methods of exporting should be initially used.THE VALUE OF PLANNINGMany companies begin export activities haphazardly, without carefully screening markets or options for market entry. While these companies may or may not have a measure of success, they may overlook better export opportunities.In the event that early export efforts are unsuccessful because of poor planning, the company may even be misled into abandoning exporting altogether.Formulating an export strategy based on good information and proper assessment increases the chances that the best options will be chosen, that resources will be used effectively, and that efforts will consequently be carried through to completion.The purposes of the export plan are, first, to assemble facts, constraints, and goals and, second, to create an action statement that takes all of these into account. The statement includes specific objectives; it sets forth time schedules for implementation; and it marks milestones so that the degree of success can be measured and help motivate personnel.The first draft of the export plan may be quite short and simple, but it should become more detailed and complete as the planners learn more about exporting and their company's competitive position. At least the following ten questions should ultimately be addressed:1. What products are selected for export development? What modifications, if any, mustbe made to adapt them for overseas markets?2. What countries are targeted for sales development?3. In each country, what is the basic customer profile? What marketing and distributionchannels should be used to reach customers?4. What special challenges pertain to each market (competition, cultural differences,import controls, etc.), and what strategy will be used to address them?5. How will the product's export sales price be determined?6. What specific operational steps must be taken and when?7. What will be the time frame for implementing each element of the plan?8. What personnel and company resources will be dedicated to exporting?9. What will be the cost in time and money for each element?10. How will results be evaluated and used to modify the plan?One key to developing a successful plan is the participation of all personnel who will be involved in the exporting process. All aspects of an export plan should be agreed upon by those who will ultimately execute them.A clearly written marketing strategy offers six immediate benefits:1. Because written plans display their strengths and weaknesses more readily, they areof great help in formulating and polishing an export strategy.2. Written plans are not as easily forgotten, overlooked, or ignored by those charged withexecuting them. If deviation from the original plan occurs, it is likely to be due to adeliberate choice to do so.3. Written plans are easier to communicate to others and are less likely to bemisunderstood.4. Written plans allocate responsibilities and provide for an evaluation of results.5. Written plans can be of help in seeking financing. They indicate to lenders a seriousapproach to the export venture.6. Written plans give management a clear understanding of what will be required andthus help to ensure a commitment to exporting. In fact, a written plan signals thatthe decision to export has already been made.This last advantage is especially noteworthy. Building an international business takes time; itis usually months, sometimes even several years, before an exporting company begins to see a return on its investment of time and money. By committing to the specifics of a written plan, top management can make sure that the firm will finish what it begins and that the hopes that prompted its export efforts will be fulfilled.THE PLANNING PROCESS AND THE RESULTA crucial first step in planning is to develop broad consensus among key management on the company's goals, objectives, capabilities, and constraints.The first time an export plan is developed, it should be kept simple. It need be only a few pages long, since important market data and planning elements may not yet be available.The initial planning effort itself gradually generates more information and insight that can be incorporated into more sophisticated planning documents later.From the start, the plan should be viewed and written as a management tool, not as a static document. For instance, objectives in the plan should be compared with actual results as a measure of the success of different strategies. Furthermore, the company should not hesitate to modify the plan and make it more specific as new information and experience are gained.A detailed plan is recommended for companies that intend to export directly.Companies choosing indirect export methods may require much simpler plans. APPROACHES TO EXPORTINGThe way a company chooses to export its products can have a significant effect on its export plan and specific marketing strategies. The basic distinction among approaches to exporting relates to a company's level of involvement in the export process. There are at least four approaches, which may be used alone or in combination:1. Passively filling orders from domestic buyers who then export the product.These sales are indistinguishable from other domestic sales as far as the original seller is concerned. Someone else has decided that the product in question meets foreigndemand. That party takes all the risk and handles all of the exporting details, in somecases without even the awareness of the original seller.(Many companies take a stronger interest in exporting when they discover that theirproduct is already being sold overseas.)2. Seeking out domestic buyers who represent foreign end users or customers.Many foreign corporations, general contractors, foreign trading companies, foreigngovernment agencies, foreign distributors and retailers, and domestic companies aswell purchase for export. These buyers are a large market for a wide variety of goodsand services. In this case a company may know its product is being exported, but itis still the buyer who assumes the risk and handles the details of exporting.3. Exporting indirectly through intermediaries.With this approach, a company engages the services of an intermediary firm capableof finding foreign markets and buyers for its products. Export management companies(EMCs), export trading companies (ETCs), international trade consultants, and otherintermediaries can give the exporter access to well-established expertise and tradecontacts. Yet, the exporter can still retain considerable control over the process andcan realize some of the other benefits of exporting, such as learning more about foreigncompetitors, new technologies, and other market opportunities.4. Exporting directly.This approach is the most ambitious and difficult, since the exporter personally handlesevery aspect of the exporting process from market research and planning to foreigndistribution and collections. Consequently, a significant commitment of managementtime and attention is required to achieve good results. However, this approach may also be the best way to achieve maximum profits and long-term growth. With appropriate help and guidance from the Department of Commerce, state trade offices, freight forwarders, international banks, and other service groups, ev en small or medium-sizedfirms, can export directly if they are able to commit enough staff time to the effort.For those who cannot make that commitment, the services of an EMC, ETC, tradeconsultant, or other qualified intermediary are indispensable.If the nature of the company's goals and resources makes an indirect method of exporting the best choice, little further planning may be needed. In such a case, the main task is to find a suitable intermediary firm that can then handle most export details.Firms that are new to exporting or are unable to commit staff and funds to more complexexport activities may find indirect methods of exporting more appropriate.Using an EMC or other intermediary, however, does not exclude all possibility of directexporting for the firm. An exporter may also choose to gradually increase its level of direct exporting later, after experience has been gained and sales volume appears to justify added investment.Get more information or data on different approaches to exporting and their advantages and disadvantages. Consulting advisers before making these decisions can be helpful. Management Issues Involved in the Export DecisionManagement objectives• What are the company's reasons for pursuing export markets? Are they solid objectives(e.g., increasing sales volume or developing a broader, more stable customer base) orare they frivolous (e.g., the owner wants an excuse to travel)?• How committed is top management to an export effort? Is exporting viewed as a quick fix for a slump in domestic sales? Will the company neglect its export customers ifdomestic sales pick up?• What are management's expectations for the export effort?How quickly does management expect export operations to become self-sustaining?What level of return on investment is expected from the export program?Experience• With what countries has business already been conducted, or from what countries have inquiries already been received?• Which product lines are mentioned most often?• Are any domestic customers buying the product for sale or shipment overseas?If so, to what countries?• Is the trend of sales and inquiries up or down?• Who are the main domestic and foreign competitors?• What general and specific lessons have been learned from past export attempts or experiences?Management and personnel• What in-house international expertise does the firm have (international sales experience, language capabilities, etc.)?• Who will be responsible for the export department's organization and staff?• How much senior management time (a) should be allocated and (b) could be allocated?• What organizational structure is required to ensure that export sales are adequately serviced?• Who will follow through after the planning is done?Production capacity• How is the present capacity being used?• Will filling export orders hurt domestic sales?• What will be the cost of additional production?• Are there fluctuations in the annual work load? When? Why?• What minimum order quantity is required?• What would be required to design and package products specifically for export?Financial capacity• What amount of capital can be committed to export production and marketing?• What level of export department operating costs can be supported?• How are the initial expenses of export efforts to be allocated?• What other new development plans are in the works that may compete with export plans?• By what date must an export effort pay for itself?。