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
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 |
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 |
Answer / harsh
You can use HASH lookup for this. Performnace will depend
on the data size.
| Is This Answer Correct ? | 0 Yes | 0 No |
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 |
What do the SAS log messages "numeric values have been converted to character" mean?
what is metadata? : Sas-bi
This entry was posted in General. Bookmark the permalink. Post a comment or leave
is it possible to generate sas datasets using proc print ???
1 Answers GSK GlaxoSmithKline,
What statement do you code to tell SAS that it is to write to an external file?
What are the 3 components in sas programming?
Mention what is SAS data set?
If reading a variable length file with fixed input, how would you prevent SAS from reading the next record if the last variable didn?t have a value?
my problem is to export my report to xsl.i can do that.but the problem is my report has 3 headings first heading should be printed with the merging of (1-5)cells and heading 2 should be of merge(2-4)cells?how to do this condition?
What do the sas log messages “numeric values have been converted to character” mean? What are the implications?
In SAS explain which statement does not perform automatic conversions in comparisons?
In which case u go for libname and in which case u go for proc sql pass thru facilit diff?