Stack Data Loop - SAS Macro -


I have 51 files (I raise unemployment rate for all 50 states and DC from BLS), and give me them Need to pile up one another I'm working on a macro which will import files and then pile them, but I'm stuck on how I can write a loop to pile them. I'm only storing the first and the last data sets, and nothing in between. I'm not sure what I'm doing, any help would be greatly appreciated Thanks in advance.

  / * Import imported raw data files * /% macro import; Repeat% = 1% & amp; Files; Data_null_; Set files (where = (file = & regenerative)); Call simt ('infil', left (trim (filename)); Call simpat ('state', left (trim (state)); Run; % Put and Infail; % Put and State; / * Import Raw data files * / proc import datafile = "& amp; raw & amp; infile" = & amp; State dbms = xls; Getnames = yes; Namerow = 11; Datarow = 12; Run; / * Create a new State column / data and state; Set and state; State = "and state"; Run; % If & amp; Restart = 1% then%; Data merge 1; The employment of the workers of the year unemployment unemployment; statehood; Format Year 4. Period $ 3 Labor_force employment unemployment comma 12.2 Berojagari_ret 4.2 state $ 24.; Set & amp; state; Run; %End; % If & amp; Repeat & gt; % 1%; Data unemployed_memory; The employment of the workers of the year unemployment unemployment; statehood; Set merge 1 and state; Run; %End; %End; % Import Import;  

You need to change it to its second (and iterate> 1) statement:

  data merge 1; The employment of the workers of the year unemployment unemployment; statehood; Set merge 1 and state; Run;  

Otherwise, you can always create a new data set called 'unemploy_merge' with data from ITERATE = 1 and the current file. This is the reason that you only see the first and the last in the end.


Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -