Prev: Problem when using the SAS/GRAPH Procedures: SGPLOT and SGPANEL
Next: Notes produced from proc mixed
From: pigpigpig on 19 Jan 2010 18:16 Hi, Thanks for any tips: I have over 400 daily tbls on Unix.. Majority of these tables have identical fields and types (char/num) Just a few of them have slightly different fields due to changes in production.. but i am not sure what dates it started from. I built a marco to store all the daily tables' names.. and try to use proc append.. FORCE option to append them.. ( SET in data step doesn't work because of the dicrepancy among the tables, that is why I think the FORCE option in proc append may help). I thought i was smart.. unfortunately, I got stuck.. Seems proc append can only combine two tables at a time. rsubmit; proc sql ; Select table_names into : tbl_nm separated by ' ' from all_table_names; quit; proc append data=base_table data=&tbl_nm force; run; endrsubmit; Wendy
From: pigpigpig on 19 Jan 2010 18:17 On Jan 19, 6:16 pm, pigpigpig <pigzhu...(a)gmail.com> wrote: > Hi, > > Thanks for any tips: > > I have over 400 daily tbls on Unix.. Majority of these tables have > identical fields and types (char/num) > Just a few of them have slightly different fields due to changes in > production.. but i am not sure what dates it started from. > > I built a marco to store all the daily tables' names.. and try to use > proc append.. FORCE option to append them.. ( SET in data step doesn't > work because of the dicrepancy among the tables, that is why I think > the FORCE option in proc append may help). I thought i was smart.. > unfortunately, I got stuck.. > Seems proc append can only combine two tables at a time. > > rsubmit; > proc sql ; > Select table_names into : tbl_nm separated by ' ' > from all_table_names; > quit; > > proc append data=base_table data=&tbl_nm force; > run; > > endrsubmit; > > Wendy Note that my tables are all on unix.. not local
From: shiva on 20 Jan 2010 04:06 Hi Wendy, How about writing a loop over proc append.Some thing like this inside your macro code. Hope this helps...Try this... proc sql ; select table_names into :var1 - :var400 from all_table_names; select count(table_names) into :cnt from all_table_names; quit; %do i=1 to &cnt; %do table=var&i; proc append base=base_table data=&table force; run; %end; %end; Thanks, shiva
From: =?ISO-8859-1?Q?Daniel_Fern=E1ndez?= on 20 Jan 2010 12:03 I think you forgot to resolve macro variable table with only a &. I mean you must type data=&&table first & resolve table= var&i second & resolve var&i =var1 (when i=1 ...) proc append base=base_table data=&&table force; run; Daniel Fernandez. Barcelona. 2010/1/20 shiva <shiva.saidala(a)gmail.com>: > Hi Wendy, > > How about writing a loop over proc append.Some thing like this inside > your macro code. > > Hope this helps...Try this... > > > proc sql ; > select table_names into :var1 - :var400 from all_table_names; > select count(table_names) into :cnt from all_table_names; > quit; > %do i=1 to &cnt; > %do table=var&i; > > proc append base=base_table data=&table force; > run; > %end; > %end; > > Thanks, > shiva >
From: =?ISO-8859-1?Q?Daniel_Fern=E1ndez?= on 20 Jan 2010 12:06 sorry for correcting your forgotten mistakes :( %do i=1 to &cnt; should be typed %do i=1 %to &cnt; Dani El d�a 20 de enero de 2010 18:03, Daniel Fern�ndez <fdezdan(a)gmail.com> escribi�: > I think you forgot to resolve macro variable table with only a &. > > I mean you must type data=&&table > first & resolve table= var&i > second & resolve var&i =var1 (when i=1 ...) > > proc append base=base_table data=&&table force; > run; > > > Daniel Fernandez. > Barcelona. > > > 2010/1/20 shiva <shiva.saidala(a)gmail.com>: >> Hi Wendy, >> >> How about writing a loop over proc append.Some thing like this inside >> your macro code. >> >> Hope this helps...Try this... >> >> >> proc sql ; >> select table_names into :var1 - :var400 from all_table_names; >> select count(table_names) into :cnt from all_table_names; >> quit; >> %do i=1 to &cnt; >> %do table=var&i; >> >> proc append base=base_table data=&table force; >> run; >> %end; >> %end; >> >> Thanks, >> shiva >> >
|
Next
|
Last
Pages: 1 2 3 Prev: Problem when using the SAS/GRAPH Procedures: SGPLOT and SGPANEL Next: Notes produced from proc mixed |