Hi @Tom , @Kurt_Bremser @ballardw , and @andreas_lds
It is a long day for me and I am really excited that I have the chance to learn a lot from your suggestion. The picture is much more clearer.
First of all, I can separate the meaning of import/export data with the call or copy data from one to another library.
Secondly, I follow @Tom and @ballardw 's way of doing things ( using SET statement to concatenate dataset)
@Tom wrote:
Libname input 'C:\Users\pnguyen\OneDrive - Massey University\PhD JOURNEY\3calculation - Copy' access=readonly;
proc contents data=INPUT._ALL_ noprint out=contents;
run;
proc sql noprint;
select distinct catx('.',libname,memname)
into :dslist separated by ' '
from contents
;
quit;
data want;
set &dslist.;
run;
And, you have converted from a program that copies one dataset to one that creates three empty datasets.
data work.ds1 set input.ds1;
run;
Can I ask why one creates three empty datasets? why "three"? Thank you.
And as @ballardw notice, I hit the wall which fails me from getting the result. So, I follow @ballardw's specified proc tabulate to identify the mystery behind and it ends up like that my variable BDATE contains both numeric and char types.
@ballardw also gave me a solution that
What you are looking for: Variables where the row indicates both types of variable, numeric or character. These are the ones that will cause your process to fail. Pick one type and modify all the variable to the same type.
Can you please tell me how to code to "pick one type"? And what type do you think the date should be? char or numeric?
The current code is as below
Libname input 'C:\Users\pnguyen\OneDrive - Massey University\PhD JOURNEY\3calculation - Copy' access=readonly;
proc format;
value showx
low-high='x'
;
run;
proc tabulate data=sashelp.vcolumn;
where libname='INPUT' and memtype='DATA';
class memname name type length;
table name*type*length,
memname*n=' '*f=showx.
/misstext=' '
;
run;
And I cannot understand the meaning of these codes, could you please explain it to me, especially "low-high='x'", I can't see any high or low variables so far in my current session.
proc format;
value showx
low-high='x'
;
run;
And last but not least, @ballardw also mentioned the length assigned of variables
Ideally you should also specify a format for those variables because you could create a variable of length $ 500 but one of the contributing variables sets the display format to $10. and you then wonder where the data went when all that is happening is that your format isn't displaying the full value.
I am quite confused about the bold lines. From my novice understanding, $500 already contains $10, so I just think we set all length to $500.
Many thanks and warmest regards,
... View more