To answer your questions:
1) Is "sheet" redundant ? - I don't think so. You assigned erroneously the line
out= cats(substr(fname,1,3),sheet1) /* or sheet&i */
instead I suggested: short_fn = substr(fname,1,3);
and then argument outf is concatenation of short_fn and "sheet"
finaly out=&outf.1 or out=&outf.&1
If you deleted the "sheet" - did you got output names as wanted?
You probably got shorter names like Arg1 instead Arg_sheet1.
2) PUT statement is used to right to a file (not a sas dataset).
In your case you write to the log. That is the default output file.
In such case it is preffered to use PUTLOG instead just PUT.
To write to specific file you code like:
FILENAME <fref> "<Path and file_name>;
/* 'fref' stands for File Reference and is limited to 8 chracters. */
/* in a data step you code */
FILE <fref>; /* declaring to which file to write */
PUT <text to write>;
That answers your other (3rd & 4th) question too;
Thank you very much, I almost made a mistake. Yes, I just check and it is exactly what you mentioned about the sheets' names. I just changed as your instruction and it is what I need.
Many thanks and warmest regards!
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.