Hi Folks,
I have two libraries named in1 & in2 both consist the datasets with same naming convention .For eg: test1 & test1
i.e in1.test1 & in2.test1.
Though the naming convention is same fields inside the datasets may or may not differ.
suppose I have added two fields named age and place in the source file. and they will reflect in both the datasets with same or different values ,because they might be separated on basis of key identifiers.
Could you please help me how to find the values for added fields w.r.t to library in the same sas program.
Thanks
Nitesh
Do you just need to "print" them? If so you can use:
proc report data=in1.test1 nowd; columns _all_; run;
The _all_ will use all available columns.
If you need to do something more complicated, then you would consult the metadata tables, e.g. this would get you all variables found in both library in1 and 2, and datasets test1 and 2:
data want; set sashelp.vcolumn (where=(libname in ("IN1","IN2") and memname in ("TEST1","TEST2"))); run;
Or
Proc print data=<any valid data set name>;
run;
Will print the entire data set, all values all rows.
Or you need to show by concrete example what you mean for output.
Once you have created a data set the only way to tell "new" variables, if this is the core of your question and not printing, then you would have to preserve a list of variables from the "old" data set.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.