You can use the same approach to solve the previous problem by creating another format to associate the prices with the corresponding parts.However,formatted values are always character variables, and you need a numeric variable for PRICE so that you can multiply it by QUANTITY to get TOTAL.One more function (INPUT) and you're done:
The output is shown next:
Output from Example-Looking Up Two Variables (Method 2 - Formats)
Although the PUT and INPUT functions are described in Chapter 5, "SAS Functions," we briefly explain the use of the INPUT function in this
example.The result of the PUT function is a string which is the character representation of the price of each item (technically called a numeral).
The INPUT function instructs the system to take the value of the first argument (PUT(PART_NO,PRICE.)) and "read it again" according to the informat listed as the second argument (5.).Therefore,the value of PUT (PART_NO,PRICE.) is a character string such as 25.00; the result of the line,INPUT (PUT(PART_NO, PRICE.) ,5.) is then number 25.After reading this paragraph a few times (and maybe taking a walk around the block a few times).
SAS Programming Related Tutorials
|SASS (Syntactically Awesome Style sheets) Tutorial||R Programming language Tutorial|
SAS Programming Related Interview Questions
|Logistics Interview Questions||SAS Programming,SQL server Interview Questions|
|Clinical SAS Interview Questions||SASS (Syntactically Awesome Style sheets) Interview Questions|
|SQL Server Analysis Services (SSAS) Interview Questions||R Programming language Interview Questions|
|SAS DI Interview Questions||Advanced SAS Interview Questions|
|Base Sas Interview Questions||SAS Macro Interview Questions|
|Clinical Data Management Interview Questions|
Sas Programming Tutorial
Input And Infile
Set, Merge, And Update
Table Lookup Tools
Proc Means And Proc Uimivariate
All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.