BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
ghartge
Quartz | Level 8

Greetings,

I produced a table using EG and uploaded it to a specific folder on the LASR server using the "Upload to LASR" menu item when right-clicking the table in EG. This works fine and the process also places the code and a link in the process flow window in my project that accomplishes this task. (Please see image)

 

When I run the project again at a later time the tables on the LASR server are not updated/replaced. 

 

If I delete the tables on the LASR server they will be added back when the code is run again. On occasion one of the three will update without it being deleted first, but nothing consistent.

 

Here are the results of the log when I run the "upload to LASR" module from my Process Flow window by right-clicking and selecting "Run". I get the same results when I run the entire process as well. (emphasis in red is mine);

 

 

1 The SAS System 10:47 Friday, January 12, 2018

NOTE: Writing TAGSETS.SASREPORT13(EGSR) Body file: EGSR
NOTE: Libref TMP00023 was successfully assigned as follows: 
Engine: SASIOLA 
Physical Name: SAS LASR Analytic Server engine on local host, port 10031

NOTE: Deleting TMP00023.R570_7_6_2017_FB_TRUSTEE (memtype=DATA).
NOTE: The table VAPUBLIC.R570_7_6_2017_FB_TRUSTEE has been removed from the SAS LASR Analytic Server.
NOTE: PROCEDURE DATASETS used (Total process time):
real time 0.45 seconds
cpu time 0.05 seconds


NOTE: There were 202497 observations read from the data set WORK.R570_7_6_2017_FB_TRUSTEE.
NOTE: The data set TMP00023.R570_7_6_2017_FB_TRUSTEE has 202497 observations and 35 variables.
NOTE: DATA statement used (Total process time):
real time 1.21 seconds
cpu time 0.17 seconds

INFO: Registering /Public - No Logon/Fact_Book/Fact_Book_Data/ to /Shared Data/SAS Visual Analytics/Public/Visual Analytics Public 
LASR library.

NOTE: A total of 1 tables were analyzed for library "Visual Analytics Public LASR".
NOTE: Metadata for 0 tables was updated.
NOTE: Metadata for 0 tables was added.
NOTE: Metadata for 1 tables matched the data sources.
NOTE: 0 tables listed in the SELECT or EXCLUDE statement were not found in either the metadata or the data source.
NOTE: 0 other tables were not processed due to error or UPDATE_RULE.
NOTE: PROCEDURE METALIB used (Total process time):
real time 1.40 seconds
cpu time 0.19 seconds


NOTE: The data set WORK.UPLOAD_LASR_SMP_REPORT has 5 observations and 2 variables.
NOTE: DATA statement used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds


NOTE: There were 5 observations read from the data set WORK.UPLOAD_LASR_SMP_REPORT.
NOTE: PROCEDURE REPORT used (Total process time):
real time 0.00 seconds
cpu time 0.01 seconds

NOTE: Libref TMP00023 has been deassigned.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
SASKiwi
PROC Star

My approach is to use SAS code for this. The steps are:

proc datasets library = lasrlib nolist;
  delete MyLASRTable;
run;
quit;

data lasrlib.MyLASRTable;
  set MySASTable;
run;

 proc metalib;
   omr (library = "LASRLIB");
   folder       = "MyLASRFolder";
   select       = ("MyLASRTable");
 run;

 

 

View solution in original post

7 REPLIES 7
SASKiwi
PROC Star

To replace a LASR server table you first delete it, then upload the new table, then register the table in metadata. Are you able to provide the source code from the task you are using to confirm what it is doing? There are no obvious problems in the LOG notes that I can see.

ghartge
Quartz | Level 8

Thanks, SASkiwi,

 

I am trying to programmatically (from the Process Flow) update a table or as you mentioned, delete it, and then reload it without any manual interaction. I would like this to be scheduled and run.

 

Thanks,

 

Gary

SASKiwi
PROC Star

My approach is to use SAS code for this. The steps are:

proc datasets library = lasrlib nolist;
  delete MyLASRTable;
run;
quit;

data lasrlib.MyLASRTable;
  set MySASTable;
run;

 proc metalib;
   omr (library = "LASRLIB");
   folder       = "MyLASRFolder";
   select       = ("MyLASRTable");
 run;

 

 

SASKiwi
PROC Star

My approach is to use SAS code for this. The steps are:

proc datasets library = lasrlib nolist;
  delete MyLASRTable;
run;
quit;

data lasrlib.MyLASRTable;
  set MySASTable;
run;

 proc metalib;
   omr (library = "LASRLIB");
   folder       = "MyLASRFolder";
   select       = ("MyLASRTable");
 run;

 

 

ghartge
Quartz | Level 8

Thank you SASKiwi,

 

I tried your code and was able to delete the table and load it back. The only issue I have is with this section;

 proc metalib;
   omr (library = "LASRLIB");
   folder       = "MyLASRFolder";
   select       = ("MyLASRTable");
 run;

I receive this error;

ERROR: No metadata objects found matching the specified URI. 

 

The question I guess is what folder do I list for "MyLASRFolder" I understand that "MyLASRServer" isn't what I should use, I did replace that with a folder on our LASR server. Actually, the table I am working with is in the folder titled "Visual Analytics Public LASR" which I used in your code example.

 

proc metalib;
omr (library = "LASRLIB");
 folder = "Visual Analytics Public LASR";
select = ("EOT_Data");
run;

 

Thank you or the help. I really like the simplicity of your code.

 

Gary

utrocketeng
Quartz | Level 8

i use two macro's (one called from within another) to check
1. that the data set exists that i am going to upload to LASR
  if it doesnt (fails to be created), then i email myself
2. if it does exist, drop the current table in LASR
3. load the data from work to LASR

here is the code i use.  the macro call at the bottom gets it all rolling:

LIBNAME LASRLIB META Library="Visual Analytics Public LASR" METAOUT=DATA;

/* Remove existing table from LASR if loaded already */
%macro deletedsifexists(lib,name);
%if %sysfunc(exist(&lib..&name.)) %then %do;
%put DeletDSifExistsMacro;
proc datasets library=&lib. nolist;
delete &name.;
quit;
%end;
%mend deletedsifexists;

/*Macro to check to see if expected dataset exists and if so, then do stuff*/
%macro CheckResult(Slib,Sname,Tlib,Tname,email);
%PUT Source Data &Slib..&Sname.;
%PUT Target Data &Tlib..&Tname ;
%if %sysfunc(exist(&Slib..&Sname.)) %then %do;
%put CheckResultMacro;
%deletedsifexists(&Tlib, &Tname);

/* Loading through the SASIOLA Engine */
data &Tlib..&Tname ( );
set &Slib..&Sname ( );
run;
%end;
%else %do;
%put Expected dataset does not exists (&Slib..&Sname.), need to email someone;
filename mailbox email
TO=(&email)
FROM=('NoReply <NOREPLY@CompanyName.com>')
SENDER = ('NoReply <NOREPLY@CompanyName.com>')
IMPORTANCE='HIGH'
replyto='NOREPLY@CompanyName.com'
Subject='SAS VA Dataset Loading Failed';

DATA _NULL_;
FILE Mailbox;
PUT "Greetings,";
PUT " This is a message from a SAS.";
PUT "Expected dataset does not exists (&Slib..&Sname.)";
PUT "may need to do something";
RUN;
%end;
%mend CheckResult;

/*SourceLib, SourceTab, TargetLib, TargeTab, email addresses*/
%CheckResult(work, TableNameInWork, LASRLIB, TableNameInLASR, 'person@CompanyName.com' );

ghartge
Quartz | Level 8

Thank you for the reply utrocketengineer,

 

I do like the functionality of what you are doing with the MACRO code. I wish I were more versed in MACRO coding. I have just haven't got there yet. I do understand what you are doing though and it makes sense. I will test it out here.

 

The simplicity of the previous contributor is also something I thought we should be able to do and although it does lack some functionality compared to your example, it is efficient and effective.

 

You have set the challenge for me though and I will endeavor to persevere!

 

Thanks!

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 7 replies
  • 2479 views
  • 3 likes
  • 3 in conversation