BookmarkSubscribeRSS Feed
don21
Quartz | Level 8

Dear all,

 

I am facing lot of trouble currently with the below situation that I am in. Request your help/ideas in solving this:

 

I have recently finished a project for which the requirement was:

 

There were so many raw sources for a report (soo many, trust me). I need to import them all in sas, do the calc and then export them into excel using ODS into the exact same format as the existing manual excel report they have been currently using. The current manual report consists of YTD data, Jan till date, they add numbers everymonth.

 

But my SAS report consists of only one month data as we did it as a testing phase and was almost successful.

Now, the challenge is that I need to do the same for all the other months and bring out the actual complete report. but my code is written to accommodate only one month data at a time. the imnport part I have done in EG without hardcoding, so if I need to import another month I have to change the month name and  data set names in the code and run the entire process flow. Also I need to include the appned queries and append the data sets to the first created dataset each time I import a new month data.

 

I find this really complex because, even if I manage to do this for now, when I handover this code, the others should be able to handle and mantain it.

 

Request you to kindly suggest some good ideas to deal with the sitiation..

 

Many Thanks..

 

2 REPLIES 2
Kurt_Bremser
Super User

If you have already arrived at a stage where you only have to set a macro variable once and the code works on its own, then you just need to wrap your code into a macro that has the month macro variable as a parameter.

After that, you can call the macro repeatedly with call execute() off a dataset of months.

Reeza
Super User

You need to redesign your process so your data import and reporting are separated. So you first import and append your data in one step or process flow and then use a second to create the reports. This way the second, just uses the output from the first step of importing. 

 

Given what you've said it's harder to provide any further advice because it's a relatively vague question. But in general if you know you're going to have to automate a process it should be designed with some of those considerations in mind but that comes with time as well. 

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 2 replies
  • 644 views
  • 0 likes
  • 3 in conversation