DATA Step, Macro, Functions and more

Proc Export - Skip first column in excel

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 15
Accepted Solution

Proc Export - Skip first column in excel

I need some help on exporting a data set to excel.

 

My data looks like this;

 

date                colour       total   

02/01/2016     blue             2

02/01/2016     yellow          5

 

In my excel workbook, my report will be using vlookups to determine the number of blue vs. yellow on Feb.1st.  Therefore, I will be making a concatenated field of the date & colour.  I would like to make this concatenated field the first column (column A) in my data sheet and don't want to have to create the column daily.  How do I export the above 3 columns by skipping column A on my data sheet?  I would like to replace everything in the data sheet daily with the exception of column A.

 


Accepted Solutions
Solution
‎03-29-2016 04:01 PM
Occasional Contributor
Posts: 15

Re: Proc Export - Skip first column in excel

I have figured it out.  I concatenated the 2 fields.  Prior to concatenating I added 21916 to the date field.  Excel could then read the date.

View solution in original post


All Replies
Super User
Posts: 3,102

Re: Proc Export - Skip first column in excel

A couple of thoughts:

 

  • You could easily do the analysis you describe in SAS without exporting to Excel.
  • If you still wish to use Excel you could concatenate your two columns in SAS, then export also column A. 
Occasional Contributor
Posts: 15

Re: Proc Export - Skip first column in excel

 

 

I tried to concatenate the 2 fields in sas but it concatenates differently than in excel because of the date.

Super User
Posts: 3,102

Re: Proc Export - Skip first column in excel

Please post what you want as your concatenated column and also what you have tried in SAS.

Super User
Super User
Posts: 7,401

Re: Proc Export - Skip first column in excel

As @SASKiwi mentioned, why do it in Excel at all, SAS is designed to do statistics?  If you have to use Excel, why use SAS?  You seem to be using things just because they are there.  

As for this concatenating columns, that doesn't sound like a good idea to me.  If you do it in SAS you can use group by <var1>,<var2>, or by group processing.  If using Excel then there are other functions available, countif() is one that jumps to mind.  Check what you need to do, and why, then decide what software is better suited to the purpose.

Solution
‎03-29-2016 04:01 PM
Occasional Contributor
Posts: 15

Re: Proc Export - Skip first column in excel

I have figured it out.  I concatenated the 2 fields.  Prior to concatenating I added 21916 to the date field.  Excel could then read the date.

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 5 replies
  • 292 views
  • 0 likes
  • 3 in conversation