BookmarkSubscribeRSS Feed
TarquinKrikery
Calcite | Level 5

 Hi All,

 

I regularly use EG to produce (semi) automated data extractions.I have a question which i can't seem to find the answer to anywhere so hoping some of you can help.

 

I have an EGP which extracts a bunch of data for a bunch of a list of individuals (changes each week, as does the volume of people) from different tables from all over our database. Most of the tables are Oracle and some are HUGE and because it can takes a while to bring back the data back, I pull all the data for all individuals, at the same time.

 

Because of skills in house, we tend not to use a lot of Program nodes as we have to QA all work to check it's ok and there is a lack of SAS skills in department meaning this is not an issues, so I'm using Query/Append/Transpose nodes etc to get work done. 

 

 

The second 'part' of the eg, then munges the data together for the first individual in the list and formats it into a usable report which is output.

 

What I'm trying to do, is get the EG to then loop back to the start of the second 'part' to re-run steps 10-20 (for example) and munge together individuals 2's data, then loop back to do individual 3 etc until it's finished.

 

Anyone got any ideas how I can achieve this? I'm at a bit of a loss!

 

Cheers

4 REPLIES 4
Kurt_Bremser
Super User

My preferred course of action:

Save those steps 10-20 (or whatever) to a SAS program, parameterize via macro variables set from environment variables, and then use a shell script on the server that iterates through all your users. If you push the individual SAS batch runs into the background, you can even execute them in parallel.

Simplified example:

SAS program

%let name=%sysget(NAME);

proc print data=sashelp.class;
where name = "&name";
run;

shell script:

for NAME in Alfred Jane
do
  export NAME
  /sasconf/Lev1/SASApp/BatchServer/sasbatch.sh program.sas -print $HOME/lst/program_${NAME}.lst -log $HOME/log/program_${NAME}.log
done
TarquinKrikery
Calcite | Level 5

Thanks, I hadn't considered that. I'll have a look into this and see how I get on!

Kurt_Bremser
Super User

Note that once you start writing your codes like that, it becomes rather easy to have them run from a scheduling system. Commandline jobs lend themselves very well to this.

TomKari
Onyx | Level 15

Note that the above discussion involves getting into code nodes, and possibly stand-alone SAS programs. If you're comfortable with this, it's clearly the way to go.

 

If you want to stay within the EG tasks, I think the easiest option is to try to rearrange things to do each step for all persons at once, and then for your reporting use some kind of BY processing to individualize the reports.

 

Tom

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!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 4 replies
  • 2351 views
  • 1 like
  • 3 in conversation