Go Back   Rhinocerus > Newsgroup > Newsgroup comp.soft-sys.sas

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 08-07-2012, 06:43 PM
chadmcrawford@gmail.com
Guest
 
Posts: n/a
Default Same date in code multiple times.... is there a way

So I have the same date in my code to grab different data sets, and If i want to change the month from say 072012 to 082012. Rathter then do it in every data step is it possible to make it so I only have to change it once?
Reply With Quote
Alt Today
Advertising
 
and become member of Rhinocerus
Standard Sponsored Links

  #2 (permalink)  
Old 08-07-2012, 07:23 PM
Ya Huang
Guest
 
Posts: n/a
Default Re: Same date in code multiple times.... is there a way

On Tuesday, August 7, 2012 11:43:01 AM UTC-7, (unknown) wrote:
> So I have the same date in my code to grab different data sets, and If i want to change the month from say 072012 to 082012. Rathter then do it in every data step is it possible to make it so I only have to change it once?


Make it a macro variable, then you only need to change it once.
Reply With Quote
  #3 (permalink)  
Old 08-07-2012, 07:46 PM
chadmcrawford@gmail.com
Guest
 
Posts: n/a
Default Re: Same date in code multiple times.... is there a way

On Tuesday, August 7, 2012 3:23:22 PM UTC-4, Ya Huang wrote:
> On Tuesday, August 7, 2012 11:43:01 AM UTC-7, (unknown) wrote: > So I have the same date in my code to grab different data sets, and If i want to change the month from say 072012 to 082012. Rathter then do it in every data step is it possible to make it so I only have to change it once? Make it a macro variable, then you only need to change it once.


How would I make it a macro variable?
Reply With Quote
  #4 (permalink)  
Old 08-07-2012, 09:23 PM
Reeza
Guest
 
Posts: n/a
Default Re: Same date in code multiple times.... is there a way

On Tuesday, August 7, 2012 12:46:55 PM UTC-7, (unknown) wrote:
> On Tuesday, August 7, 2012 3:23:22 PM UTC-4, Ya Huang wrote:
>
> > On Tuesday, August 7, 2012 11:43:01 AM UTC-7, (unknown) wrote: > So I have the same date in my code to grab different data sets, and If i want to change the month from say 072012 to 082012. Rathter then do it in every data step is it possible to make it so I only have to change it once? Make it a macro variable, then you only need to change it once.

>
>
>
> How would I make it a macro variable?


%let my_date=082012;

%put &my_date;

data want;
set extract_&my_date;
run;

Reply With Quote
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT. The time now is 04:23 AM.


Copyright ©2009

LinkBacks Enabled by vBSEO 3.3.0 RC2 © 2009, Crawlability, Inc.