03-29-2016 03:27 PM
I need some help with adding addtional columns to my report. This is a new report that I send someone on a daily basis.
The file is currently set up with the first column being the initial variable and the following columns resulting from transpose procedures.
Now on a daily basis the amount of total columns can change depending on the data, but the person I am sending this to needs it at a consistant amount of columns everyday.
-For instance my report today shows these as columns - Inventory|Var1|Var2|Var3
-I need the following on a daily basis no matter if the columns are null - Inventory|Var1|Var2|Var3|Var4|Var5|Var6|Var7|Var8|Var9
Any ideas would be greatly appreciated.
03-29-2016 03:32 PM
03-29-2016 03:33 PM
How are you creating the report- Proc Report, Proc Print, Proc Tabulate, something else?
How are you reading the input data?
One way would involve having an empty data set with all of the variables, (keep a copy for reuse) append your daily data and then generate your report with columns with missing data.
But you need to be sure that your incoming data doesn't EVER change data type from period to period.
03-29-2016 03:44 PM
Sorry, can we start with what software you are using to create this "report". It sounds to me like you are creating data for a data transfer, i.e. data that will be sent out. The term "report" is used to define output files used for review.
If it is indeed a data transfer, then setup a template dataset, which has all the necessarry columns, with the necessary properties - per the data transfer document (which you will have yes) - then append your data to this template before sending, e.g.:
proc sql; create table TEMPLATE (INVENTORY char(20),VAR1 num,VAR2 char(20)); quit; data send_data; set template mydata; run;
03-30-2016 08:24 AM
Thank you for your reply. I used the term "report" loosely. Yes this would be considered a data transfer, I will try each of these to see what works, but I think this one might work.