120124luciandaymond 120125fonghofmeister data

Info icon This preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: tina,Ngan, ... 120123,Kimiko,Hotstone, ... 120124,Lucian,Daymond, ... 120125,Fong,Hofmeister, ... data work.subset3; infile 'sales.csv' dlm=','; input Employee_ID First_Name $ Last_Name $ Gender $ Salary Job_Title $ Country $; run; Implicit OUTPUT; Implicit RETURN; 1 2 Input Buffer 1234567890123456789012345 120103,Wilson,Dawes,M,879 Input Buffer 1 2 1234567890123456789012345 120103,Wilson,Dawes,M,879 PDV Employee First_ _ID Name $8 N8 120103 Wilson PDV Last _Name $8 Dawes Gender $8 M Employee First_ _ID Name $8 N8 120103 Wilson Job_ Country Title $8 $8 87975 Sales Ma AU Salary N8 ... 39 Gender $8 M Job_ Country Title $8 $8 87975 Sales Ma AU Salary N8 ... 40 Execution Execution Partial sales.csv Output SAS Data Set after Second Iteration of DATA Step Work.subset3 Employee First_ _ID Name 120102 Tom 120103 Wilson Last _Name $8 Dawes Last _Name Zhou Dawes Gender M M Job_ Country Title 108255 Sales Ma AU 87975 Sales Ma AU Salary 120102,Tom,Zhou, ... 120103,Wilson,Dawes, ... 120121,Irenie,Elvish, ... 120122,Christina,Ngan, ... 120123,Kimiko,Hotstone, ... 120124,Lucian,Daymond, ... 120125,Fong,Hofmeister, ... Continue until EOF data work.subset3; infile 'sales.csv' dlm=','; input Employee_ID First_Name $ Last_Name $ Gender $ Salary Job_Title $ Country $; run; Input Buffer 1 2 1234567890123456789012345 120103,Wilson,Dawes,M,879 PDV Employee First_ _ID Name $8 N8 120103 Wilson 41 ... Last _Name $8 Dawes Gender $8 M Job_ Country Title $8 $8 87975 Sales Ma AU Salary N8 42 7 7.03 Multiple Choice Poll The LENGTH Statement Which statement is true? The LENGTH statement defines the length of a variable explicitly. a. Data is read directly from the raw data file to the PDV. b. At the bottom of the DATA step, the contents of the PDV are output to the output SAS data set. c. When SAS returns to the top of the DATA step, any variable coming from a SAS data set is set to missing. General form of the LENGTH statement: LENGTH variable(s) $ length; Example: length First_Name Last_Name $ 12 Gender $ 1; add a attribute to the variable gender is only M or F which don't need 8 space 43 44 Business Scenario Business Scenario Create a temporary SAS data set named Work.subset3 from the delimited raw data file named sales.csv. data work.subset3; length First_Name $ 12 Last_Name $ 18 Gender $ 1 Job_Title $ 25 Country $ 2; infile 'sales.csv' dlm=','; input Employee_ID First_Name $ Last_Name $ Gender $ Salary Job_Title $ Country $; run; p107d02 45 proc print data=work.subset3; run; Partial PROC PRINT Output Zhou Dawes Elvish Ngan Hotstone Daymond Hofmeister Denny Clarkson Kletschkus Roebuck Lyon Gender M M F F F M M M F F M M Country Job_Title Sales Sales Sales Sales Sales Sales Sales Sales Sales Sales Sales Sales Manager Manager Rep. II Rep. II Rep. I Rep. I Rep. IV Rep. II Rep. II Rep. IV Rep. III Rep. I Employee_ ID Salary AU AU AU AU AU AU AU AU AU AU AU AU 120102 120103 120121 120122 120123 120124 120125 120126 120127 120128 120129 120130 108255 87975 26600 27475 26190 26480 32040 26780 28100 30890 30070 26955 p107d02 46 Compilation PDV 47 Last_Name Tom Wils...
View Full Document

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern