So based on your example, I would highly recommend you take some SAS training course. More specifically the SAS Macro Language 1: Essentials course(please note that the prerequisite for this course is the SAS Programming 2: Data Manipulation Techniques).
The macro course is two days of training and will help you understand that you are mixing compile time statements and execution time statements in your example, which means that it will never work.
So to answer you First question, "getting the result of Ps command stored in users home directory temp1.txt and storing that value in a macro" here is how i would handle this.
You can try using the data step to read the text file and use call symputx to create a macro variable.
Here is an example using the pipe command(you need to have x commands enabled for this to work on a sas server).
filename filelist pipe 'stat -c %s /home/temp1.txt '; data _null_; infile filelist truncover; input filename $100.; call symputx("newMacro",filename); /*This puts the entire piped contents into the macro, i think you might want to use a sas function to filter this value*/
run; run;
Here is how you would store the current time in a macro variable;
%let time=%sysfunc(time(),time16.);
Hope this helps.
Carmine
... View more