i have dataset named one and it has many observation and i want to extract num variables into dataset named Number and char variables in Character dataset how to do this please help me out...!!!
Doing what you ask is easy:
data just_nums (keep=_numeric_) just_chars (keep=_character_);
set have;
run;
However, you have to realize that this is less than useless. It is destructive. Once you have separated them, and there are no common variables in the two data sets, how will you ever put them back together again? There is no SAS-based reason to do this. Perhaps there is an academic reason?
Doing what you ask is easy:
data just_nums (keep=_numeric_) just_chars (keep=_character_);
set have;
run;
However, you have to realize that this is less than useless. It is destructive. Once you have separated them, and there are no common variables in the two data sets, how will you ever put them back together again? There is no SAS-based reason to do this. Perhaps there is an academic reason?
When you posted your question, you were shown this:
Stop right there! Before pressing POST, tick off this checklist. Does your post …
✔ Have a descriptive subject line, i.e., How do I ‘XYZ’? | ✔ Use simple language and provide context? Definitely mention what version you’re on. | ✔ Include code and example data? Consider using the SAS Syntax feature. |
Use simple language. Try to use correct spelling, as many of the non-native-English speakers here will have trouble deciphering Pidgin. This includes proper use of punctuation marks and capitals where necessary.
Include the code you already have, and most important, example data. Use the macro provided in https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat... to convert your dataset into a data step that can be posted in a code window (6th ({i}) and 7th ("little running man") icons above the main posting window). Also provide the expected result of the intended action.
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.