Hi I have list of products in a dataset,
which are classified by other name for eg:- there is a
product A> Malambo Shiraz Malbec 750ML(0388) which is a Red
wine.Now i need to generate a report where it shows if this
product appears then it should b displayed as red
wine,similarly for other products and other classification.
I dont wan use proc format.

Answers were Sorted based on User's Feedback



Hi I have list of products in a dataset, which are classified by other name for eg:- there is a p..

Answer / chandrakanth

please do not post complex answers if it can be done in very very simple.

data=dataset name;
set source dataset name;
if productA="Malambo Shiraz Malbec 750ML(0388)" then productA='Red Wine';
proc print data=dataset name;
run;

let me know if i am wrong

Is This Answer Correct ?    4 Yes 1 No

Hi I have list of products in a dataset, which are classified by other name for eg:- there is a p..

Answer / sheetal

above answer is correct. Just need to correct syntax
errors. Following is the corrected code,

proc sql;
update [dataset_name]
set [wine_name_field] = "Red Wine" where [wine_name_field]
="Malambo Shiraz Malbec 750ML(0388)";
quit;

Is This Answer Correct ?    2 Yes 0 No

Hi I have list of products in a dataset, which are classified by other name for eg:- there is a p..

Answer / harsh

You can use HASH lookup for this. Performnace will depend
on the data size.

Is This Answer Correct ?    0 Yes 0 No

Hi I have list of products in a dataset, which are classified by other name for eg:- there is a p..

Answer / saurabh

Hi.

I don t know any specific reason why yu dont wan to use
proc format. It would be better if you use that as there
would be probably some more wines in the market where u can
apply this format of red wine....
Anyways I think you can try this.
* the content in brackets have to come from your program

proc sql;
update [dataset_name];
set [wine_name_field] = "Red Wine" where [wine_name_field]
="Malambo Shiraz Malbec 750ML(0388)";
exit;

let me know in case u require something else.

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More SAS Interview Questions

What are the statements that are executed only?

0 Answers  


What are the five ways to do a table lookup in sas? : sas-grid-administration

0 Answers  


what techniques and/or procs do you use for tables? : Sas programming

0 Answers  


If you have a data set that contains 100 variables, but you need only five of those, what is the code to force SAS to use only those variable?

16 Answers  


How to specify variables to be processed by the freq procedure?

0 Answers  






In the SAS Data step what is the difference between the subsetting done by Where and subsetting done by If?

6 Answers   Cognizant,


How do you download a flat file from Mainframe to your local PC using SAS?

3 Answers  


WHAT DIFFERRENCE DID YOU FIND AMONG VERSION 6 8 AND 9 OF SAS.

4 Answers   Genzyme,


How to select the observations randomly from a SAS dataset

7 Answers   NTT Data,


How to do user inputs and command line arguments in SAS? D&B

2 Answers   BoA, Quintiles,


what is data governance? : Sas-di

0 Answers  


what is the difference between compiler and interpreter? give any one example (software product) that act as a interpreter?

36 Answers   Accenture, College School Exams Tests, CTS, IBM, IHRD, Infosys, Sylhet Engineering College, TCS, Wipro,


Categories