BookmarkSubscribeRSS Feed
sathya66
Barite | Level 11

Hi All,

I have two different excel files .

one excel file is creating automatically by automated programme(automatically sending email to concerned persons)  another one is a static file (the values from this files never change). so I want to combine this excel files into one excel file with two different tabs before sending to automated email report .

Thanks,

6 REPLIES 6
RW9
Diamond | Level 26 RW9
Diamond | Level 26

"the values from this files never change" - if this is true, then you do not need the second file at all.  The program which creates the first output can also create the second output in the same step, hence problem solved:

data fixed;
  a=1; b=2;
run;

ods tagsets.excelxp...;
ods tagsets.excelxp options(sheet_name="First");
proc print data=have;
run;
ods tagsets.excelxp options(sheet_name="Second");
proc print data=fixed;
run;
...
sathya66
Barite | Level 11
one file values will be changed because it is a monthly report and another one doesn't change. so I need to add these files together
RW9
Diamond | Level 26 RW9
Diamond | Level 26

The point is, if the second file never changes then drop it totally and add it into the generation of the other output file, there is no adding of files needed, your just adding another step in then.  The monthly report should be updated to output the default tab also, one minor change in one place and problem solved.

sathya66
Barite | Level 11
1.automatic report.xls (this will be changed always because it is creating by using proc report and sending automatic email to the users)
2.values.xls.(this won't change and this is in local drive and this is also a report but created by me with colors and etc.).
so I need to combine these excel files and needs to be send automated mails to users.
RW9
Diamond | Level 26 RW9
Diamond | Level 26

1.automatic report.xls (this will be changed always because it is creating by using proc report ** at which point values tab can also be written out as it is fixed and never changes ** and sending automatic email to the users)
2.values.xls.(this won't change and this is in local drive and this is also a report but created by me with colors and etc.).
so I need to combine these excel files and needs to be send automated mails to users.

 

Alternatively:

1) create first report

2) create second report

3) have an excel template with vba code which loads both and outputs a new combined file

4) then run code to send file to users

Thus 4 times the number of steps, twice the technologies used, at least one change to existing process (unless the original file is still to go out at that point also), and the whole Excel part which will likely fall over when not in a perfect environment (i.e. move to linux which doesn't have Excel).

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 6 replies
  • 818 views
  • 0 likes
  • 3 in conversation