BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
yeaforme
Calcite | Level 5

Now that this thread is coming to a close, how do I (or do I?) give credit to those that helped?  I notice in other threads there are "Useful Answers" and "Correct Answers" labeled and would like to give credit those that have helped where due.

Linlin
Lapis Lazuli | Level 10

to label as correct or helpful answers, you need to log in first. then at the lower portion of the box that surrounds each response there are two icons: one that indicates "correct answer" and one that indicates "helpful answer".

yeaforme
Calcite | Level 5

Not seeing any icons - I see Branch, Like, and Reply and that is all.  And yes, I am logged in.

Linlin
Lapis Lazuli | Level 10

Hi,

please check the attached screen shot. do you see something like that?


correct answer.png
yeaforme
Calcite | Level 5

Nope, not there.  This is all I see.  And yes, I am logged on.


screenshot.png
FriedEgg
SAS Employee

%macro double_transpose_file(file);

data foo;

infile "&file" dsd dlm=',' lrecl=32767 missover;

input @;

_infile_=prxchange('s/#n\/a//o',-1,_infile_);

input var :$32. (val1-val657) (:$100.); *<--<</Assumption is every file has same number of initial columns;

run;

proc transpose data=foo out=bar(drop=_name_);

id var;

var val1-val657; *<--<</Assumption is every file has same number of initial columns;

run;

proc sql noprint;

select name into :name1-:name2

   from dictionary.columns

  where libname='WORK' and memname='BAR'

having varnum=4 or varnum=max(varnum);

quit;

proc transpose

data = bar

out = foobar( rename = ( col1   =amount

                           _name_ =date    )

               where  = ( not missing(amount) )

          );

  by     name code currency notsorted;

  var    "&name1"n -- "&name2"n;

  run;

proc append

base=want

data=foobar;

run;

%mend;

%macro run_on_dir;

filename dir&sysindex pipe "dir /s /b C:\path\to\files\*.csv"; *<--<<Enter path to files here;

data _null_;

  infile dir&sysindex end=done;

  input;

  call symputx(cats('file',_n_),_infile_);

  if done then call symputx('nfiles',_n_);

run;

%do i=1 %to &nfiles;

  %double_transpose_file(&&file&i);

%end;

%mend;

%run_on_dir;

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 35 replies
  • 5454 views
  • 6 likes
  • 9 in conversation