Find Jobs
Hire Freelancers

Quick Piece of SAS Code/Guidance

$10-30 USD

Pågår
Lagt ut nesten 2 år siden

$10-30 USD

Betalt ved levering
I am trying to adapt some code that relies on a date field so that can run it for a number of month ends, I have done the inevitable google searches and got the code below to run a loop but whilst I have no problem having the start date as an input, ideally I would like to make the months input to be calculated as the number of months from the start date input to today's system date . The next thing is that I need to understand how to include the date from the each run of the loop as the criteria for a number of different pieces of SAS code that will follow after. So currently the code I am running uses the date variable &EMTH_SQL1 that has come from a previous piece of code in a PROC SQL statement via a "WHERE" statement (e.g. WHERE BAL_DATE=&EMTH_SQL1) where &EMTH_SQL1 is the most recent end of month date. I need to understand how I change this statement to use the "e" variable to run the loop (which would be 87 times over using the example piece of code I have shown below, although as mentioned I would like to make this dynamic). The final bit is when I have created the data set using Proc SQL how I insert the month end date into the final data set name so that I have (in this case) 87 data sets with different names reflecting the different month end dates The next thing is that I am posting this at 9am UK time July 28th and need turnaround in hours %macro get_data(start=, months=87); /* Convert start/end values into SAS dates */ %let start_dt = %sysfunc(inputn(&start., date9.)); %do i = 0 %to &months.; /* Calculate the start and end months for the month of data in the loop */ %let month_e = %sysfunc(intnx(month, &start_dt., &i., E) ); %put %cmpres( %sysfunc(putn(&month_e., date9.))); /***********************************/ /***** SQL/DATA Step goes here *****/ /***********************************/ %end; %mend; %get_data(start=31JAN2011);
Prosjekt-ID: 34236174

Om prosjektet

Eksternt prosjekt
Aktiv 2 år siden

Ønsker du å tjene penger?

Fordeler med budgivning på Freelancer

Angi budsjettet og tidsrammen
Få betalt for arbeidet ditt
Skisser forslaget ditt
Det er gratis å registrere seg og by på jobber

Om klienten

SWITZERLANDs flagg
Hitchin, Switzerland
5,0
17
Medlem siden jun. 16, 2010

Klientbekreftelse

Takk! Vi har sendt deg en lenke for at du skal kunne kreve din gratis kreditt.
Noe gikk galt. Vær så snill, prøv på nytt.
Registrerte brukere Publiserte jobber
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Forhåndsvisning innlasting
Tillatelse gitt for geolokalisering.
Påloggingsøkten din er utløpt og du har blitt logget ut. Logg på igjen.