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

Hi , I am struggling to make the data step hash object work with proc imstat score hashdata. I am following this example:

http://support.sas.com/documentation/cdl/en/inmsref/68736/HTML/default/viewer.htm#p1bvghq0m6b0wgn1fy...

 

One important quote from the example is "The names specified in the program code are the actual table names in the server, and not the names where a libref masks the tag.". As you will see below I am doing that. The fact that default tag in LASR is called "work" is just coincidence and has nothing to do with SASwork.

 

libname lasrlib sasiola PORT=10095 HOST="host.xyz.com";
/*
NOTE: No tag was specified in the LIBNAME statement. The default tag (WORK) is used to name and identify tables in the LASR 
       Analytic Server. You can specify a tag as a data set option.
NOTE: Libref LASRLIB was successfully assigned as follows: 
       Engine:        SASIOLA 
       Physical Name: SAS LASR Analytic Server engine on host 'host.xyz.com', port 10095
*/
 
data a;
  x=1; output;
  x=2; output;
run;
proc sql; drop table lasrlib.a; quit;
data lasrlib.a; set a; run;
/*
NOTE: The data set WORK.A has 2 observations and 1 variables.
NOTE: DATA statement used (Total process time):
       real time           0.00 seconds
       cpu time            0.00 seconds
NOTE: The table WORK.A has been removed from the SAS LASR Analytic Server.
NOTE: Table LASRLIB.A has been dropped.
NOTE: PROCEDURE SQL used (Total process time):
       real time           6.24 seconds
       cpu time            0.01 seconds
NOTE: There were 2 observations read from the data set WORK.A.
NOTE: The data set LASRLIB.A has 2 observations and 1 variables.
NOTE: DATA statement used (Total process time):
       real time           0.02 seconds
       cpu time            0.00 seconds
*/
 
data b;
  x=1; y=11; output;
  x=2; y=12; output;
run;
proc sql; drop table lasrlib.b; quit;
data lasrlib.b; set b; run;
/*
NOTE: The data set WORK.B has 2 observations and 2 variables.
NOTE: DATA statement used (Total process time):
       real time           0.00 seconds
       cpu time            0.00 seconds
NOTE: The table WORK.B has been removed from the SAS LASR Analytic Server.
NOTE: Table LASRLIB.B has been dropped.
NOTE: PROCEDURE SQL used (Total process time):
       real time           0.01 seconds
       cpu time            0.00 seconds
NOTE: There were 2 observations read from the data set WORK.B.
NOTE: The data set LASRLIB.B has 2 observations and 2 variables.
NOTE: DATA statement used (Total process time):
       real time           0.02 seconds
       cpu time            0.00 seconds
*/
 
filename pgm clear;
filename pgm "%sysfunc(pathname(work))/pgm.txt";
data _null_;
  file pgm;
  put "declare hash h(dataset:'WORK.B');";
  put "__lasr_output = 1;";
run;
/*
NOTE: Fileref PGM has been deassigned.
NOTE: The file PGM is:
       Filename=/opt/saswork/SAS_work9FD20000AC81_xyz/SAS_work4E090000AC81_xyz/pgm.txt,
       Owner Name=u531771,Group Name=xyz,
       Access Permission=-rw-rw-r--,
       Last Modified=23Oct2016:12:44:41
NOTE: 2 records were written to the file PGM.
       The minimum record length was 18.
       The maximum record length was 33.
NOTE: DATA statement used (Total process time):
       real time           0.00 seconds
       cpu time            0.00 seconds
*/
 
proc imstat;
  table lasrlib.a;
  tableinfo;
  run;
  table lasrlib.b;
  tableinfo;
  run;
quit;
/*
Table Information
Table Name | NLS encoding | Number of Rows | Number of Columns | Owner
WORK.A     | latin1       | 2              | 1                 | u531771
WORK.B     | latin1         2                2                 | u531771 
*/
 
proc imstat;
  table lasrlib.a;
  score code=pgm hashdata(WORK.B) keep=(_ALL_) temptable;
  run;
quit;
/*
ERROR: [42S02]Table "WORK.B" does not exist or cannot be accessed (0x81bfc10b)
ERROR: [3F000]BASE driver, schema name WORK was not found for this connection (0x81bfc8d1)
ERROR: Unable to open dataset 'WORK.B' for HASH object creation.
NOTE: PROCEDURE IMSTAT used (Total process time):
       real time           0.03 seconds
       cpu time            0.02 seconds
*/

Is this a LASR setup issue? Am I doing something wrong in the code? Is anybody successfully able to run this example? 

Please help. Thanks in advance!

 

1 ACCEPTED SOLUTION

Accepted Solutions
burkheart14
Calcite | Level 5

I found out what caused this problem: I was missing the nopreparse option on the score statement. The following works now:

proc imstat;
  table lasrlib.a;
  score code=pgm hashdata(WORK.B) keep=(_ALL_) nopreparse temptable;
  run;
quit;

View solution in original post

1 REPLY 1
burkheart14
Calcite | Level 5

I found out what caused this problem: I was missing the nopreparse option on the score statement. The following works now:

proc imstat;
  table lasrlib.a;
  score code=pgm hashdata(WORK.B) keep=(_ALL_) nopreparse temptable;
  run;
quit;

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!

Tips for filtering data sources in SAS Visual Analytics

See how to use one filter for multiple data sources by mapping your data from SAS’ Alexandria McCall.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 1263 views
  • 0 likes
  • 1 in conversation