Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a DATA step to create a new table named clean_traffic based on pg2.np_monthlytraffic: Add a LENGTH statement to create a new two-character-long column named

image text in transcribed
Write a DATA step to create a new table named clean_traffic based on pg2.np_monthlytraffic: Add a LENGTH statement to create a new two-character-long column named Type. Add an assignment statement that uses the SCAN function to extract the last word from the ParkName column and assign the resulting value to Type. Use the SUBSTR function to create a new column named Park that reads each ParkName value and excludes the Type code at the end of the string. Note: Use the FIND function to identify the position number of the Type string (with any trailing blanks removed from Type). That value can be used in calculating the third argument of the SUBSTR function to specify how many characters to read. Add an assignment statement to use the UPCASE and COMPRESS functions to change the case of Region and remove any blanks. Add an assignment statement to change the case of Location to proper case. Use the COMPBL function to remove any extra blanks between words. . Use the TRANWRD function to create a new column named Gate that reads Location (after performing the previous step) and converts the string "Traffic Count At" to a blank. Create a new column named GateCode that concatenates ParkCode and Gate together with a colon (?) between the strings. Write a PROC PRINT step to display the first 10 rows of clean_traffic where Month is equal to 7. Only display the columns Type, Park, Region, Location, and GateCode, in that order. Include a descriptive title on the report. Show all your code and a screenshot of the PROC PRINT output

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

College Algebra

Authors: Cynthia Y Young

3rd Edition

1118475690, 9781118475690

More Books

Students also viewed these Mathematics questions