PROC SQL INNER JOIN QUERY - sas

i am learning sas proc sql statement. I observed that although the result are the same for following two methods, the real and cpu time is different. I wonder why there exist the difference.
data data1;
input name1 $ choice $;
datalines;
John A
Mary B
Peter C
;
run;
data data2;
input name2 $ choice2 $;
datalines;
John B
Mary C
Peter B
run;
Method 1:
proc sql;
select a.*, b.*
from data1 as a, data2 as b
where a.name1= data2.name2
;
quit;
Method 2:
proc sql;
select a.* , b.*
from data1 as a inner join data2 as b
on a.name1 = b.name2
;
quit;

Ignoring the unexplained html file and any random fluctuations in CPU and execution time for the sake of discussion, the short answer might just be that SAS handles different joins in different ways by default. Perhaps this doesn't make much of a difference with files as small as the examples here, but it's worth knowing about.
A longer answer is that this may be dependent to some extent on the exact version of SAS you're using. In SAS 9.4 with your example datasets, the query plan I see generated is the same for both joins if you leave proc sql to its own devices:
52 /* Method 1: */
53
54 proc sql _method;
55 select a.*, b.*
56 from data1 as a, data2 as b
57 where a.name1= data2.name2
58 ;
NOTE: SQL execution methods chosen are:
sqxslct
sqxjhsh
sqxsrc( WORK.DATA1(alias = A) )
sqxsrc( WORK.DATA2(alias = B) )
59 quit;
NOTE: PROCEDURE SQL used (Total process time):
real time 0.01 seconds
user cpu time 0.01 seconds
system cpu time 0.00 seconds
memory 5469.21k
OS Memory 32668.00k
Timestamp 09/08/2015 06:43:09 PM
Step Count 457 Switch Count 50
Page Faults 0
Page Reclaims 87
Page Swaps 0
Voluntary Context Switches 156
Involuntary Context Switches 14
Block Input Operations 0
Block Output Operations 16
60 /* Method 2: */
61
62 proc sql _method;
63 select a.* , b.*
64 from data1 as a inner join data2 as b
65 on a.name1 = b.name2
66 ;
NOTE: SQL execution methods chosen are:
sqxslct
sqxjhsh
sqxsrc( WORK.DATA1(alias = A) )
sqxsrc( WORK.DATA2(alias = B) )
67 quit;
NOTE: PROCEDURE SQL used (Total process time):
real time 0.01 seconds
user cpu time 0.01 seconds
system cpu time 0.00 seconds
memory 5467.81k
OS Memory 32924.00k
Timestamp 09/08/2015 06:43:09 PM
Step Count 458 Switch Count 50
Page Faults 0
Page Reclaims 26
Page Swaps 0
Voluntary Context Switches 167
Involuntary Context Switches 11
Block Input Operations 0
Block Output Operations 8
You can also confirm this via the _tree option, which produces a more verbose version of the query plan. See here for further details re the output of the _method and _tree options.
Some differences do emerge if you steer the query planner towards using different join algorithms, however:
52 /* Method 1: */
53
54 proc sql _method magic=101;
55 select a.*, b.*
56 from data1 as a, data2 as b
57 where a.name1= data2.name2
58 ;
NOTE: PROC SQL planner chooses sequential loop join.
NOTE: SQL execution methods chosen are:
sqxslct
sqxjsl
sqxsrc( WORK.DATA1(alias = A) )
sqxsrc( WORK.DATA2(alias = B) )
59 quit;
NOTE: PROCEDURE SQL used (Total process time):
real time 0.01 seconds
user cpu time 0.01 seconds
system cpu time 0.01 seconds
memory 5468.53k
OS Memory 32668.00k
Timestamp 09/08/2015 06:41:54 PM
Step Count 451 Switch Count 52
Page Faults 0
Page Reclaims 101
Page Swaps 0
Voluntary Context Switches 182
Involuntary Context Switches 14
Block Input Operations 0
Block Output Operations 8
60 /* Method 2: */
61
62 proc sql _method magic=102;
63 select a.* , b.*
64 from data1 as a inner join data2 as b
65 on a.name1 = b.name2
66 ;
NOTE: PROC SQL planner chooses merge join.
NOTE: SQL execution methods chosen are:
sqxslct
sqxjm
sqxsort
sqxsrc( WORK.DATA1(alias = A) )
sqxsort
sqxsrc( WORK.DATA2(alias = B) )
67 quit;
NOTE: PROCEDURE SQL used (Total process time):
real time 0.01 seconds
user cpu time 0.01 seconds
system cpu time 0.00 seconds
memory 5467.12k
OS Memory 32924.00k
Timestamp 09/08/2015 06:41:54 PM
Step Count 452 Switch Count 60
Page Faults 0
Page Reclaims 69
Page Swaps 0
Voluntary Context Switches 197
Involuntary Context Switches 13
Block Input Operations 0
Block Output Operations 16
For more details on the magic= option, see here. I don't recommend using it in any sort of production environment, but it can sometimes be useful for this sort of thing.
Given the tiny differences in CPU time for files this small even when forcing SAS to use different merge methods, I very much suspect some other factor is causing this; probably the mystery html file.

Related

Data step - unexpected performance behaviour in where-clause

As the title suggests, I experience some unexpected performance behaviour while working with a datastep.
A. The following code executes in 0.01 sec. So far so good.
data policen_roh;
set dwhprod.tbwh_kdu_detail_hi(
keep=
kdu_dt_id police_nr record_typ kdnr bag betrag_akt ursp_beginn_dt beginn_dt ablauf_dt storno_dt
where=(
police_nr=406045267
and record_typ='P'
)
)
;
run;
B. Additionally I have to filter a date, which is stored in a date-id, starting at 1 for 01/01/1850. Since I created formats to convert the date-id to a year (integer), I added the line input(put(kdu_dt_id, tag_id2jahr.),best.) ge 2017.
Works as expected. No problem here. I get my 15 expected records, and execution time increases marginally to 0.02 sec:
data policen_roh;
set dwhprod.tbwh_kdu_detail_hi(
keep=
kdu_dt_id police_nr record_typ kdnr bag betrag_akt ursp_beginn_dt beginn_dt ablauf_dt storno_dt
where=(
police_nr=406045267
and input(put(kdu_dt_id, tag_id2jahr.),best.) ge 2017
and record_typ='P'
)
)
;
run;
C. Now here is the problem: In an effort to speed up my code for larger datasets, I replaced
input(put(kdu_dt_id, tag_id2jahr.),best.) ge 2017
with
kdu_dt_id gt 60997 - the equivalent of 01/01/2017.
To my understanding, this should be way faster, since there is no put/input calculation required. However, while this returns the same result as B., execution time increases to roughly 30.00 seconds.
What is did I miss?
Appendix: Log for further reference
1 The SAS System 13:56 Wednesday, February 7, 2018
1 ;*';*";*/;quit;run;
2 OPTIONS PAGENO=MIN;
3 %LET _CLIENTTASKLABEL='Programm';
4 %LET _CLIENTPROJECTPATH='R:\Projekte\20180125 Erneuerungsprovisionen\Erneuerungsprovisionen.egp';
5 %LET _CLIENTPROJECTNAME='Erneuerungsprovisionen.egp';
6 %LET _SASPROGRAMFILE=;
7
8 ODS _ALL_ CLOSE;
9 OPTIONS DEV=ACTIVEX;
10 GOPTIONS XPIXELS=0 YPIXELS=0;
11 FILENAME EGHTML TEMP;
12 ODS HTML(ID=EGHTML) FILE=EGHTML
13 ENCODING='utf-8'
14 STYLE=HtmlBlue
15 STYLESHEET=(URL="file:///C:/Program%20Files%20(x86)/SASHOME/x86/SASEnterpriseGuide/7.1/Styles/HtmlBlue.css")
16 ATTRIBUTES=("CODEBASE"="http://www2.sas.com/codebase/graph/v94/sasgraph.exe#version=9,4")
17 NOGTITLE
18 NOGFOOTNOTE
19 GPATH=&sasworklocation
20 ;
NOTE: Writing HTML(EGHTML) Body file: EGHTML
21
22 GOPTIONS ACCESSIBLE;
23 data policen_roh;
24 set dwhprod.tbwh_kdu_detail_hi(
25 keep=
26 kdu_dt_id police_nr record_typ kdnr bag betrag_akt ursp_beginn_dt beginn_dt ablauf_dt storno_dt
27 where=(
28 police_nr=406045267
29 and kdu_dt_id gt 60997
30 and record_typ='P'
31 )
32 )
33 ;
34 run;
NOTE: There were 14 observations read from the data set DWHPROD.TBWH_KDU_DETAIL_HI.
WHERE (police_nr=406045267) and (kdu_dt_id>60997) and (record_typ='P');
NOTE: The data set WORK.POLICEN_ROH has 14 observations and 10 variables.
NOTE: Compressing data set WORK.POLICEN_ROH increased size by 100.00 percent.
Compressed is 2 pages; un-compressed would require 1 pages.
NOTE: DATA statement used (Total process time):
real time 1:10.44
cpu time 0.03 seconds
35
36 GOPTIONS NOACCESSIBLE;
37 %LET _CLIENTTASKLABEL=;
38 %LET _CLIENTPROJECTPATH=;
39 %LET _CLIENTPROJECTNAME=;
40 %LET _SASPROGRAMFILE=;
41
42 ;*';*";*/;quit;run;
43 ODS _ALL_ CLOSE;
44
45
46 QUIT; RUN;
2 The SAS System 13:56 Wednesday, February 7, 2018
47
My guess is that your underlying table is on a database, and the removal of the input / put functions changed the query execution such that it is no longer making use of available indexes.
A bit counterintuitive, but try removing kdu_dt_id gt 60997 from your where clause and put it in a gating if statement instead.
data policen_roh;
set dwhprod.tbwh_kdu_detail_hi(
keep=
kdu_dt_id police_nr record_typ kdnr bag betrag_akt ursp_beginn_dt beginn_dt ablauf_dt storno_dt
where=(
police_nr=406045267
and record_typ='P'
)
)
;
if kdu_dt_id gt 60997;
run;
Alternatively speak to your dba about tuning your database if this is a query you will run often.
For more information, you could re-write your query using proc sql, with the _tree option (to view the execution plan). You could then use the _method option to play around / tune that plan.
Also, check out options sastrace=',,,d' sastraceloc=saslog; to show your dba more info on what is being sent to the database in terms of the underlying SQL query.

Statement not executed due to NOEXEC option

Even in proc sql I'm not using noexex then again why getting error.
same sql query in executed on hive and it give correct result no syntax error.
NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.
58 disconnect from odbc;
NOTE: Statement not executed due to NOEXEC option.
"
proc sql ;
connect to odbc (dsn=inventory user=ashu password='');
create table libname.test_table as select
c0 format=11.,
c1 format=$30. length=30,
c2 format=11.,
c3 format=11.2
from connection to odbc
(SELECT c0,c1,c2,c3
FROM test_table
limit 10;);
disconnect from odbc;
quit ;
#superfluous #Joe complete log for same
1 ;*';*";*/;quit;run;
2 OPTIONS PAGENO=MIN;
3 %LET _CLIENTTASKLABEL='Program';
4 %LET _CLIENTPROJECTPATH='C:\Users\goibibp-sas-admin\Desktop\In_Goibibo Reports\ingoibibo_inclusion.egp';
5 %LET _CLIENTPROJECTNAME='ingoibibo_inclusion.egp';
6 %LET _SASPROGRAMFILE=;
7
8 ODS _ALL_ CLOSE;
9 OPTIONS DEV=ACTIVEX;
10 GOPTIONS XPIXELS=0 YPIXELS=0;
11 FILENAME EGSR TEMP;
12 ODS tagsets.sasreport13(ID=EGSR) FILE=EGSR
13 STYLE=HtmlBlue
14 STYLESHEET=(URL="file:///C:/Program%20Files/SASHome/SASEnterpriseGuide/7.1/Styles/HtmlBlue.css")
15 NOGTITLE
16 NOGFOOTNOTE
17 GPATH=&sasworklocation
18 ENCODING=UTF8
19 options(rolap="on")
20 ;
NOTE: Writing TAGSETS.SASREPORT13(EGSR) Body file: EGSR
21
22 GOPTIONS ACCESSIBLE;
23 libname inibibo '/sasdata/sasdemo1/ingoibibo';
NOTE: Libref INIBIBO was successfully assigned as follows:
Engine: V9
Physical Name: /sasdata/sasdemo1/ingoibibo
24
25
26 proc sql;
27 connect to odbc (dsn=inventory user=goibibo password=XX);
ERROR: CLI error trying to establish connection: [unixODBC][DSI] The error message HardyHiveError could not be found in the en-US
locale. Check that /en-US/SimbaHiveODBCMessages.xml exists.
NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.
28 create table inibibo.ingoibibo_inclusion as select
29 id format=11.,
30 inclusionname format=$50. length=50,
31 displayname format=$50. length=50,
32 rateplan_id format=11.,
33 inclusion_status format=$20. length=20,
34 rateplan_status format=$20. length=20
35 from connection to odbc
36 (SELECT inc.id, inc.inclusionname, inc.displayname, ri.rateplan_id,
37 (CASE WHEN inc.isactive = true THEN 'Active Inclusion' WHEN inc.isactive = false THEN 'Non Active Inclusion' END ) as
37 ! inclusion_status,
38 (CASE WHEN ri.inclusions_id = inc.id THEN 'With rate Plan'
39 WHEN ri.inclusions_id IS NULL THEN 'Without rate Plan' END) as rateplan_status
40 FROM goibibo_inventory.hotels_inclusions inc
41 LEFT JOIN goibibo_inventory.hotels_rateinclusions ri ON (ri.inclusions_id = inc.id ););
NOTE: Statement not executed due to NOEXEC option.
42 disconnect from odbc;
NOTE: Statement not executed due to NOEXEC option.
43 quit ;
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE SQL used (Total process time):
real time 0.01 seconds
cpu time 0.02 seconds
2 The SAS System 16:29 Monday, May 9, 2016
44 /* creating index on exiting table
45 for more detail http://support.sas.com/documentation/cdl/en/sqlproc/62086/HTML/default/viewer.htm#a001395386.htm*/
46 /*proc sql;
47 create index createdon on inibibo.ingoibibo_hotel_booking(createdon);
48 quit;
49 */
50
51 /* remove table from LasR server if exist */
52 %macro lasrDeletedIfExists(lib,name);
53 %if %sysfunc(exist(&lib..&name.)) %then %do;
54 proc datasets library=&lib. nolist;
55 delete &name.;
56 quit;
57 %end;
58 %mend;
59
60 /* Load data in LasR */
61 /* inTable : reference of datasource table (lib.table) */
62 /* lasRTable : reference of target table in lasR server (lib.table) */
63 /* lasrLabel : label to use for the lasr Table (users description) */
64 %macro loadDataInLasR(inTable,lasRTable,lasrLabel);
65 proc options option=MEMSIZE;run;
66 data VALIBLA.&lasRTable (label=&lasrLabel);set inibibo.&inTable;run;
67 %mend;
68
69 /* Refresh metadata for the selected lasR table */
70 %macro updateMetadataForLasrTable(lasrLibref,mdsTargetFolder,lasrTableName);
71 proc metalib;
72 omr (LIBURI="SASLibrary?#libref='&lasrLibref'" );
73 /*no more used : update_rule=(delete);*/
74 report(type=summary);
75 folder="&mdsTargetFolder";
76 select=("&lasrTableName");
77 run;
78 %put PROC METALIB returned &SYSRC.;
79 %mend;
80
81
82
83 /* Access the LASR library */
84 LIBNAME VALIBLA SASIOLA TAG=HPS PORT=11001 HOST="nmclbi01.nm.ibibo.com"
84 ! SIGNER="http://nmclbi01.nm.ibibo.com:7080/SASLASRAuthorization" ;
NOTE: Libref VALIBLA was successfully assigned as follows:
Engine: SASIOLA
Physical Name: SAS LASR Analytic Server engine on local host, port 10011
85
86 /* remove table from memory if loaded in lasr server
87 * Param1 : LASR libref
88 * Param2 : LASR table name
89 */
90
91 %lasrDeletedIfExists(VALIBLA, ingoibibo_inclusion);
NOTE: Deleting VALIBLA.INGOIBIBO_INCLUSION (memtype=DATA).
NOTE: The table HPS.INGOIBIBO_INCLUSION has been removed from the SAS LASR Analytic Server.
NOTE: PROCEDURE DATASETS used (Total process time):
3 The SAS System 16:29 Monday, May 9, 2016
real time 0.70 seconds
cpu time 0.03 seconds
92
93
94 /* Load data in LasR
95 * Param1 : local table to read
96 * Param2 : LASR table to push (write) in LASR server
97 * Param3 : Label to use for user description on the table
98 */
99 %let etls_endtime = %sysfunc(datetime(), datetime20.);
100
101 %loadDataInLasR(ingoibibo_inclusion,ingoibibo_inclusion,Loaded on &etls_endtime.);
SAS (r) Proprietary Software Release 9.4 TS1M3
MEMSIZE=96745808640
Specifies the limit on the amount of virtual memory that can be used during a SAS session.
NOTE: PROCEDURE OPTIONS used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
NOTE: There were 45690 observations read from the data set INIBIBO.INGOIBIBO_INCLUSION.
NOTE: The data set VALIBLA.INGOIBIBO_INCLUSION has 45690 observations and 6 variables.
NOTE: DATA statement used (Total process time):
real time 1.58 seconds
cpu time 0.05 seconds
102
103
104 /* Update metadata for the selected lasr table
105 * Param1 : LASR library libref
106 * Param2 : Target metadata server folder
107 * Param3 : LASR table name (only the table name, no libref)
108 */
109 %updateMetadataForLasrTable(VALIBLA,/Shared Data/SAS Visual Analytics/Public/LASR,ingoibibo_inclusion);
NOTE: A total of 1 tables were analyzed for library "Visual Analytics LASR".
NOTE: Metadata for 1 tables was updated.
NOTE: Metadata for 0 tables was added.
NOTE: Metadata for 0 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.96 seconds
cpu time 0.11 seconds
PROC METALIB returned 0
110
111
112 GOPTIONS NOACCESSIBLE;
113 %LET _CLIENTTASKLABEL=;
114 %LET _CLIENTPROJECTPATH=;
4 The SAS System 16:29 Monday, May 9, 2016
115 %LET _CLIENTPROJECTNAME=;
116 %LET _SASPROGRAMFILE=;
117
118 ;*';*";*/;quit;run;
119 ODS _ALL_ CLOSE;
120
121
122 QUIT; RUN;
Now I face same issue in all reports. before today all reports are running without error but suddenly error reflecting in all reports
NOEXEC is set when PROC SQL sees an error in an earlier step. It will then not execute any further lines of code, but it will check their syntax.
In this case, you'll need to look further up the log to see what's happened - either the connection attempt failed, or the select query failed.
Solution for same mention db name in proc sql query like dbname.tablename it will run with out error.
proc sql ;
connect to odbc (dsn=inventory user=ashu password='');
create table libname.test_table as select
c0 format=11.,
c1 format=$30. length=30,
c2 format=11.,
c3 format=11.2
from connection to odbc
(SELECT c0,c1,c2,c3
FROM db_name.test_table
limit 10;);
disconnect from odbc;
quit ;

Applying cutoff to data set with IDs

I am using SAS and managed to run proc logistic, which gives me a table like so.
Classification Table
Prob Correct Incorrect Percentages
Level Event Non- Event Non- Correct Sensi- Speci- FALSE FALSE
Event Event tivity ficity POS NEG J
0 33 0 328 0 9.1 100 0 90.9 . 99
0.02 33 62 266 0 26.3 100 18.9 89 0 117.9
0.04 31 162 166 2 53.5 93.9 49.4 84.3 1.2 142.3
0.06 26 209 119 7 65.1 78.8 63.7 82.1 3.2 141.5
How do I include IDs for the rows of data in lib.POST_201505_PRED below that have at least 0.6 probability?
proc logistic data=lib.POST_201503 outmodel=lib.POST_201503_MODEL descending;
model BUYER =
age
tenure
usage
payment
loyalty_card
/outroc=lib.POST_201503_ROC;
Score data=lib.POST_201505 out=lib.POST_201505_PRED outroc=lib.POST_201505_ROC;
run;
I've been reading the documentation and searching online but haven't found anything on it. I must be searching for the wrong keywords, as I presume this is a frequently used process.
You just need an id-statement to tell SAS your ID-variable identifies your observations;
proc logistic data=lib.POST_201503 outmodel=lib.POST_201503_MODEL descending;
id ID;
model BUYER = age tenure usage payment loyalty_card
/outroc=lib.POST_201503_ROC;
Score data=lib.POST_201505
out=lib.POST_201505_PRED
outroc=lib.POST_201505_ROC;
run;
Now your output contains all you need.
For instance to print the IDs that get had probability of at least 0.6 assigned of being a BUYER to them;
proc print data=lib.POST_201505_PRED (where=(P_1 GE 0.6));
var ID P_1;
run;
You find these id yourKey; statements throughout the statistical procedures in SAS, for instance ;
proc univariate data=psydata.stroop;
id Subject;
var ReadTime;
run;
** will report the most extreme values of ReadTime as
;
Turns out I just had to include the ids in lib.POST_201505

How can I disable automatic options statements in SAS University Edition?

Whenever I submit code in SAS University Edition, statements like this are inserted automatically and show up in the log:
OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
What causes this, and is there a way to disable it? I'm not even sure whether these statements are doing anything, as all the associated content is still displayed in the log.
After following Dwal's suggestion below, here is all of the additional generated code:
1 OPTIONS NOSYNTAXCHECK;
2 TITLE;
3 FOOTNOTE;
4 OPTIONS LOCALE=en_US DFLANG=LOCALE;
5 DATA _NULL_;
6 VALUE=GETOPTION("VALIDVARNAME");
7 CALL SYMPUT("_WEBVVN", VALUE);
8 RUN;
NOTE: DATA statement used (Total process time):
real time 0.00 seconds
cpu time 0.01 seconds
9 OPTIONS VALIDVARNAME=V7;
10 FILENAME _HTMLOUT TEMP;
11 FILENAME _GSFNAME TEMP;
12 FILENAME _DATAOUT TEMP;
13 %LET SYSCC=0;
14 %LET _CLIENTAPP=SAS Studio;
15 %LET _CLIENTAPPVERSION=3.3;
16 %LET _SASPROGRAMFILE = %BQUOTE();
17 %LET _BASEURL = %BQUOTE(http://localhost:10080/SASStudio/);
18 %LET _EXECENV=SASProgrammer;
19 DATA _NULL_;
20 CALL SYMPUT("GRAPHINIT","");
21 CALL SYMPUT("GRAPHTERM","");
22 RC=TSLVL('GEOCODE');
23 _ERROR_=0;
24 IF (RC^=' ') THEN DO;
25 CALL SYMPUT("GRAPHINIT","GOPTIONS RESET=ALL GSFNAME=_GSFNAME;");
26 CALL SYMPUT("GRAPHTERM","GOPTIONS NOACCESSIBLE;");
27 END;
28 RUN;
NOTE: Argument 1 to function TSLVL('GEOCODE') at line 22 column 4 is invalid.
NOTE: DATA statement used (Total process time):
real time 0.00 seconds
cpu time 0.01 seconds
29 DATA _NULL_;
30 RC=SYSPROD("PRODNUM002");
31 IF (RC^=1) THEN DO;
32 CALL SYMPUT("GRAPHINIT","");
33 CALL SYMPUT("GRAPHTERM","");
34 END;
35 RUN;
NOTE: DATA statement used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
36 %LET _DATAOUT_MIME_TYPE=;
37 %LET _DATAOUT_NAME=;
38 %LET _DATAOUT_TABLE=;
39 %LET _DATAOUT_URL=;
40 %SYMDEL _DATAOUT_MIME_TYPE _DATAOUT_NAME _DATAOUT_URL _DATAOUT_TABLE;
41 %LET _SASWS_ = %BQUOTE(/folders/myfolders);
42 %LET _SASWSTEMP_=%BQUOTE(/folders/myfolders/.images/c1930fcb-2ffb-4ae0-8bfe-624b39b851b9);
43 ODS LISTING CLOSE;
44 OPTIONS PRINTERPATH=PDF;
45 ODS AUTONAVIGATE OFF;
46 ODS GRAPHICS ON;
47 ODS HTML5 (ID=WEB) DEVICE=PNG GPATH="&_SASWSTEMP_" ENCODING=utf8 FILE=_HTMLOUT (TITLE='Results: Program') STYLE=Htmlblue
47 ! OPTIONS(BITMAP_MODE='INLINE' SVG_MODE='INLINE' CSS_PREFIX='.ods_c1930fcb-2ffb-4ae0-8bfe-624b39b851b9'
47 ! BODY_ID='div_c1930fcb-2ffb-4ae0-8bfe-624b39b851b9' );
NOTE: Writing HTML5(WEB) Body file: _HTMLOUT
48 &GRAPHINIT;
49 OPTIONS FIRSTOBS=1;
50 OPTIONS OBS=MAX;
51 OPTIONS DTRESET DATE NUMBER NOTES;
52 OPTIONS NOSYNTAXCHECK;
53
The bit I actually submitted:
54 data _null_;
55 put "Hello";
56 run;
Hello
NOTE: DATA statement used (Total process time):
real time 0.00 seconds
cpu time 0.01 seconds
And then some more afterwards:
57
58 OPTIONS NOSYNTAXCHECK;
59 ODS HTML CLOSE;
60 &GRAPHTERM; ;*';*";*/;RUN;QUIT;
61 QUIT;RUN;
62 OPTIONS VALIDVARNAME=&_WEBVVN;
63 %SYMDEL _WEBVVN;
64 ODS HTML5 (ID=WEB) CLOSE;
65
66 FILENAME _GSFNAME;
NOTE: Fileref _GSFNAME has been deassigned.
67 DATA _NULL_;RUN;
NOTE: DATA statement used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
67 ! OPTIONS NOTES STIMER SOURCE SYNTAXCHECK;
68
There's several places that options can be set in SAS - the below list are in order of precedence (ie #1 supercedes #2 etc):
Restricted options table, if it exists (if you're on a university sever these may have been set)
OPTIONS statement (or SAS System Options window)
Autoexec file (that contains an OPTIONS statement)
Command-line specification
Configuration file specification
SAS system default settings.
You can check the actual values of these options by sumbitting the following which will output a list of all the system options and their current values:
proc options define ;
run ;
From what you're saying, it sounds like the log is still outputing notes/source lines yes? If your seeing OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK; in your log then it's just a guess but it could be that the statement is coming from an autoexec file (#3) which is then being superceded by unitversity restricted options (#1).
You can check this from the output of the proc options statement above by looking for the value of the AUTOEXEC option as this will specify the path to the autoexec file being submitted (if there is one).

"Expecting a Name" (SAS) Proc Panel

I am receiving a very frustrating SAS error when trying to use PROC PANEL.
"Expecting a name"
I have created some sample code that reproduces the error. Any ideas on what I'm missing?
876 PROC SORT DATA=TEMP OUT=TEMPSORTED;
877 BY OBS_DATE;
878 RUN;
NOTE: There were 26 observations read from the data set WORK.TEMP.
NOTE: The data set WORK.TEMPSORTED has 26 observations and 2 variables.
NOTE: PROCEDURE SORT used (Total process time):
real time 0.02 seconds
cpu time 0.01 seconds
879
880 PROC PANEL DATA=TEMPSORTED;
881 ID OBS_DATE;
_
22
****ERROR 22-322: Expecting a name.****
882 LAG DEGREES_F(1) / OUT=TEMP_W_LAG;
ERROR: Variable NAME not found.
883 RUN;
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE PANEL used (Total process time):
real time 0.06 seconds
cpu time 0.00 seconds
Here is an entire section of code which reproduces the error:
DATA TEMP;
INPUT OBS_DATE mmddyy10. DEGREES_F #17;
FORMAT OBS_DATE mmddyy10.;
datalines;
11/01/2014 44
11/02/2014 53
11/03/2014 64
11/04/2014 61
11/05/2014 63
11/06/2014 52
11/07/2014 45
11/08/2014 49
11/09/2014 53
11/10/2014 65
11/11/2014 61
11/12/2014 33
11/13/2014 31
11/14/2014 29
11/15/2014 33
11/16/2014 33
11/17/2014 25
11/18/2014 21
11/19/2014 33
11/20/2014 30
11/21/2014 36
11/22/2014 54
11/23/2014 54
11/24/2014 51
11/25/2014 30
11/26/2014 32
;
PROC SORT DATA=TEMP OUT=TEMPSORTED;
BY OBS_DATE;
RUN;
PROC PANEL DATA=TEMPSORTED;
ID OBS_DATE;
LAG DEGREES_F(1) / OUT=TEMP_W_LAG;
RUN;
Proc Panel is for when data is both time series and cross sectional. Your data doesn't appear to be cross sectional, but time series alone.
Additionally ID requires a Cross Section ID and Time Variable. You could try to simply add a cross section ID and see if that gives you what you want, but you may want to explore other more appropriate procedures.