BookmarkSubscribeRSS Feed
CJJC
Fluorite | Level 6

Hello!  Please help a SAS EG new user.

 

I have 6 separate projects that are producing 6 final scores;

 

mylib.Level1_finalscore,

mylib.Level2_finalscore,

mylib.Level3_finalscore, etc., through mylib.Level6_finalscore

 

I then have an overall score project that adds all the scores together:  mylib.overall_finalscore

 

I needed to correct the programming in levels 1 and 2 to calculate the correct scores, and have saved them as permanent datasets. When I run the last project the updated versions of Levels 1 and 2 are not being run.  The old incorrect tables are still in the project and not the new versions.  How do I get SAS EG to recognize/update/refresh (I'm not sure what term to use) the datasets?

 

/* 1. Merge all segments and finalscore datasets.*/

Data PMdata.StackAll ;

merge PMdata.pmsegments
PMdata.Level1_overall_finalscore
PMdata.Level2_overall_finalscore
PMdata.Level3_overall_finalscore
PMdata.Level4A_overall_finalscore
PMdata.Level4B_overall_finalscore
PMdata.Level4C_overall_finalscore;
by PM_order;
if MD_PM_segment = . then delete;

Proc sort;
by PM_order;

run;

 

 

Thanks,

 

4 REPLIES 4
Patrick
Opal | Level 21

I assume new to SAS EG means new to SAS? 

SAS EG is your client with which you connect to a SAS server. SAS EG sends SAS code to a SAS server for execution and then surfaces the log and results.

The data (the SAS table) is stored on the SAS Server side.

 

Ensure that your libname for the same libref always points to the same physical path in any program and that you're always connecting to the same SAS server for running your programs (example: SASApp).

 

If above two conditions are met then first run the program that creates the tables. These tables are physical files with extension .sas7bdat and stored under the folder to which your libref points. There can only ever be a single instance (version) of such a physical file in a folder. If you change these tables then they will be changed for any program that accesses them later (as long as you execute under the same SAS Server and  the libname (libref) used points to the same folder).

 

To avoid table locking issues and ensure you're always looking at recent data make sure to set below two EG options

Patrick_0-1708300856095.png

 

 

CJJC
Fluorite | Level 6

Hello Patrick,

 

Thanks for replying.  I found the options tool -->data--->performance but unfortunately the only check box I have is "close data grid after period of inactivity (specify in minutes".  

 

I'm going to try deleting all of my finalscore datasets, then rerun the projects to see if the corrected data is then available to pull into the final project.

 

Cheers,

Patrick
Opal | Level 21

@CJJC It shouldn't be really necessary to delete all these tables if you re-run all the code that creates them. ...but it's eventually a good check to verify that you really run all the code that creates them.

 

Below a scripted approach for such a deletion.

/* select all tables under libref PMDATA that match search condition */
/* store result in macro variable &memlist                           */
proc sql noprint;
  select memname into :memlist separated by ' '
  from dictionary.tables
  where libname='PMDATA' and memname like 'LEVEL%OVERALL_FINALSCORE'
  ;
quit;

/* delete all tables listed in macro variable &memlist */
proc datasets lib=PMDATA nolist nowarn;
  delete &memlist;
quit;
CJJC
Fluorite | Level 6
Thank you so much!

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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