🔒 This topic is solved and locked.
Need further help from the community? Please
sign in and ask a new question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Posted 08-09-2021 02:35 AM
(865 views)
I have a source table/dataset and I want two separate target tables/datasets Target Table 1, Target Table 2 as below . Please advice.
Source table |
Target Table 1 |
Target Table 2 |
||||||||||||||||||||||||||||||||||||||||||
|
|
|
ID is the key column; Name and Phone No are non-key columns
I have tried below code and it worked too.
data source;
input id name $ ph $;
datalines;
10 AAA 123
20 BBB 234
30 CCC 434
40 DDD 343
50 EEE 442
;
run;
data Target1 ;
set one(drop = ph);
run;
data Target2;
set one(drop = name);
run;
Please suggest any other approach and also can we do it in single data step?
All suggestions are welcome.
Thank you.
1 ACCEPTED SOLUTION
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Try
data table1(keep= id name) table2(keep= id ph);
set source;
run;