Hi , I am struggling to make the data step hash object work with proc imstat score hashdata. I am following this example:
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!
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;
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;
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
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.