10-05-2016
Paul_NYS
Obsidian | Level 7
Member since
09-07-2012
- 216 Posts
- 0 Likes Given
- 0 Solutions
- 3 Likes Received
-
Latest posts by Paul_NYS
Subject Views Posted 3638 10-05-2016 01:16 PM 3643 10-05-2016 01:08 PM 2872 06-14-2016 03:50 PM 1849 06-14-2016 02:39 PM 2884 06-14-2016 02:35 PM 1900 06-08-2016 03:28 PM 1906 06-08-2016 03:16 PM 1396 03-22-2016 05:05 PM 1415 03-22-2016 04:10 PM 2311 02-02-2016 01:00 PM -
Activity Feed for Paul_NYS
- Got a Like for "NOTE 49-169: The meaning of an identifier after a quoted string....." error. 06-24-2019 06:50 PM
- Got a Like for "NOTE 49-169: The meaning of an identifier after a quoted string....." error. 02-26-2018 08:02 AM
- Got a Like for Exporting a SAS data set in SAS format. 03-21-2017 09:23 AM
- Posted Re: ERROR: Windows error code: 1117 in hc_disk_normal_read for....... error on SAS Procedures. 10-05-2016 01:16 PM
- Posted ERROR: Windows error code: 1117 in hc_disk_normal_read for....... error on SAS Procedures. 10-05-2016 01:08 PM
- Posted Re: MEMSIZE and FULLSTIMER options for memory issues on SAS Programming. 06-14-2016 03:50 PM
- Posted Re: Create a data set by grabbing the first <insert number> records from a larger one on SAS Programming. 06-14-2016 02:39 PM
- Posted MEMSIZE and FULLSTIMER options for memory issues on SAS Programming. 06-14-2016 02:35 PM
- Posted Re: Create a data set by grabbing the first <insert number> records from a larger one on SAS Programming. 06-08-2016 03:28 PM
- Posted Create a data set by grabbing the first <insert number> records from a larger one on SAS Programming. 06-08-2016 03:16 PM
- Posted Re: Merging two data sets and ensuring additional records are not created. on SAS Procedures. 03-22-2016 05:05 PM
- Posted Merging two data sets and ensuring additional records are not created. on SAS Procedures. 03-22-2016 04:10 PM
- Posted Re: Collapse multiple records into one and combine column values on SAS Procedures. 02-02-2016 01:00 PM
- Posted Collapse multiple records into one and combine column values on SAS Procedures. 02-02-2016 12:36 PM
- Posted Re: Proc export and 32 vs 64 bit PCs on SAS Procedures. 08-20-2015 10:51 AM
- Posted Re: Proc export and 32 vs 64 bit PCs on SAS Procedures. 08-20-2015 10:49 AM
- Posted Re: Proc export and 32 vs 64 bit PCs on SAS Procedures. 08-19-2015 04:12 PM
- Posted Proc export and 32 vs 64 bit PCs on SAS Procedures. 08-19-2015 02:26 PM
- Posted Re: Merging two data sets without adding records on SAS Programming. 06-15-2015 04:46 PM
- Posted Merging two data sets without adding records on SAS Programming. 06-15-2015 04:17 PM
-
My Liked Posts
Subject Likes Posted 2 08-25-2013 11:39 AM 1 02-03-2014 06:59 PM
12-09-2016
02:57 PM
7 Likes
Hello Paul_NYS,
The most common cause of this note is code that was submitted that contains unbalanced quotes. The circumvention is to add the missing quote and save your code. In Base SAS, you can try submitting the following line of syntax. Most of the time this statement will allow SAS to recover from the missing quote and you will not have to restart SAS.
;*%mend;*);*';*";**/; run;
If the this does not allow SAS to recover, you will have to restart SAS.
If you are running in Enterprise Guide, the circumvention is the same. You will have to add the missing quote quote and save your code. However, EG automatically submits the above line of syntax that allows you to recover from the missing quote. Simply resubmitting your code should allow you continue in the current EG session. If you are still receiving the note even after correcting the unbalanced quotes, you will have to restart your EG session.
As some of the folks who responded have mentioned, unbalanced quotes within a comment within a macro definition can also generate this note. The note listed below goes into more detail, but basically, both asterisk-style and macro-style comments are still tokenized by SAS. This means that an unmatched quote within these styles of comments is still seen as the start of a string literal. SAS always expects a closing quote to end a string litteral.
http://support.sas.com/kb/32/684.html
The best way to prevent problems with unmatched quotes contained within comments is to always use PL/1 style comments within a macro. This type of comment is not tokenized so quotes are not seen as the start to a string literal.
If the cause of the note is a quote within a comment, the circumvention is to change the comment to a PL/1 style comment and save your code. You can then try and submit the following line of code to restore your SAS session. If that does not allow you to recover, you will have to restart your SAS session.
;*%mend;*);*';*";**/; run;
The final common cause for this issue is a quoted string that contains a macro variable that was created using a macro quoting function. Below is a simple example. This problem is most likely to occur when the macro variable is the last thing listed in the quoted string.
%_eg_hidenotesandsource;
5 %_eg_hidenotesandsource;
29
30 %let x=%str(test);
31
32 %put "This is a &x"abc;
NOTE: Line generated by the macro variable "X".
32 "This is a test
_______________
49
"This is a test"abc
NOTE 49-169: The meaning of an identifier after a quoted string might change in a future SAS release. Inserting white space
between a quoted string and the succeeding identifier is recommended.
Macro quoting functions use special delta characters to mask any special characters found within the argument to the function. These delta characters can sometimes be misinterpreted in non-macro code and cause unexpected problems. The circumvention is to use the %UNQUOTE function to remove the delta characters.
%put "This is a %unquote(&x)"abc;
... View more
10-05-2016
01:16 PM
That is a good thought about the hard drive--I will try that. I thought about running it from the network drive here, but that slows things down dramatically, but the hard drive may not. Paul
... View more
06-14-2016
11:17 PM
1 Like
As mentioned, FULLSTIMER only gives you information about memory usage, it does not change memory settings.
MEMSIZE changes the maximum SAS virtual memory footprint, and must be set at the time SAS starts.
Note that some procedures are also affected by the SORTSIZE and SUMSIZE options.
Here is a schema taken from the book
High Performance SAS Coding
https://www.amazon.com/High-Performance-SAS-Coding-Christian-Graffeuille/dp/1512397490
that summarises how the memory settings are nested.
... View more
06-14-2016
02:39 PM
Yes Astounding, I actually tried this method after and it works fine as well. Going forward, this is probably what I would use. Paul
... View more
03-22-2016
10:29 PM
1 Like
If County-Docket is a unique key in s0ssrp, you can choose to use the first or the last matching record from ssrpucms2 in the following way:
data s0ssrp1 (rename=closed_reason=FtcOutcome);
merge s0ssrp (in=a) ssrpucms2 (in=b keep=County Docket ReferralDate FtcStatus closed_reason ContractDate);
by County Docket;
/* Use the first record from ssrpucms2 in a County-Docket group */
if a and (not b or first.Docket);
/* Or... */
/* Use the last record from ssrpucms2 in a County-Docket group */
if a and (not b or last.Docket);
if ReferralDate ge start and ReferralDate le stop then FtcReferred="Y";
else FtcReferred="N";
run;
... View more
02-02-2016
01:21 PM
Glad to read that it worked for you.
Maybe you have used (or heard of) PROC MEANS? It's almost the same, but writes to the output window by default.
The option MAX= of the OUTPUT statement says that
for each analysis variable specified in the VAR statement* the maximum is the summary statistic to be computed.
The names of the variables in the output dataset (here: WANT) containing the summary statistics shall be the names of the corresponding analysis variables (i.e., the maximum of SubPh1 shall be stored in a variable SubPh1, etc.). Otherwise, the new names would need to be listed after "MAX=".
By default, the output dataset contains variables _TYPE_ and _FREQ_ containing additional information about the summary: In your example, _TYPE_=1 for all observations, hence not very interesting, _FREQ_ = number of observations summarized, i.e. 3 for entity_id=165771, 5 for entity_id=230674, ... Assuming that you don't need these variables, I dropped them. More precisely: I dropped all variables whose names start with an underscore.
* Here, the VAR statement contains the list of all variables in dataset HAVE whose names start with "SubPh" (assuming that these are exactly your intended analysis variables).
... View more
08-20-2015
10:51 AM
I don't use an export wizard for exporting. I just execute the above statement in Enterprise Guide just as plain SAS code. I don't use any of the GUI in EG for running processes at all. Paul
... View more
06-16-2015
01:21 AM
Sort vgcleanD1 by entity_id descending FileDate; Then do: data s3t1; merge s3 (in=a) vgcleanD1 (keep=entity_id FileDate Docket); if a; by entity_id; if first.entity_id; run; This of course assumes that there is only one observation per entity_id in s3; if there are more, you need to make the reduction of vgcleanD1 in an intermediate step after the sort: data vgcleanD1_int; set vgcleanD1; by entity_id; if first.entity_id; run; Then use vgcleanD1_int in the merge, and omit the first.entity_id condition.
... View more
04-03-2015
09:12 PM
If you're not too fussy about how the masked values for the name string look like then below should work as well. This code uses md5() to create a 128Bit hash value, then applies a hex32 format to express these 128Bit in a 32 character string. A md5() is to a certain degree reversible so to fully mask the data a 22 character sub-string with random starting point is selected as the masked value. That should make it factually impossible to revert the masked string back to the original value. data af3; infile datalines truncover; input name $40.; datalines; Smith, John Doe, Jane, V. Jackson, Randy, G. Hanson, Therese Doe, Jane, V. ; run; data masked_name_lookup; /* set af3(keep=name);*/ /* define _masked_name with minumum length required to save memory when loading into hash table */ length _masked_name $22.; _masked_name=name; stop; run; data want(drop=_:); if _n_=1 then do; if 0 then set af3 masked_name_lookup; dcl hash Hname(dataset:'masked_name_lookup'); _rc=Hname.defineKey('name'); _rc=Hname.defineData(all:'y'); _rc=Hname.defineDone(); end; set af3 end=last; if Hname.find() ne 0 then do; _masked_name=substrn(put(md5(name),hex32.),ceil(ranuni(0)*10),22); _rc=Hname.add(); end; name=_masked_name; if last then Hname.output(dataset:'masked_name_lookup_tmp'); run; If you're using SAS9.4 then instead of md5() you could use sha256() which creates a 256Bit hash value and though makes it even more impossible to revert the masked value back to it's original. Below how the line of code would need to look like: _masked_name=substrn(put(sha256(name),hex64.),ceil(ranuni(0)*42),22);
... View more
02-13-2015
03:45 PM
Thanks Reeza. I think I remember that now actually. Sorry and thanks again. And the _n_ works nicely when you don't need a 'by' variable grouping. Paul
... View more
11-14-2014
03:18 PM
Hi, I met your same problem with the merge statement, In this post we talk about the merge statement in SAS:
... View more
10-07-2014
10:28 AM
3 Likes
Why not use proc rank , assign it with group=100 ?
... View more
10-03-2014
09:53 AM
3 Likes
Hi, Sorry for the bother, but just thought of adding an extra point in the understanding. Looking at Paigemiller and Kurt's response, I wanted to mention what happens in the PDV when SAS reads variables from an input dataset and when SAS writes variables to the output dataset. When you use any dataset option such as (rename= drop=) in the set statement, SAS executes or in your case renames these variables before the variables are brought into the PDV whereas when you use the same in the data statement, SAS just writes the renamed variables to the output dataset at the end of the exceution. Also, using dataset option is very powerful as opposed to rename/drop statement in the datastep, it helps you filter and alter your needs at an early stage before the variables are read in the memory area PDV, thus saving a lot of execution time. I hope that helps,
... View more
08-29-2014
12:34 PM
Yes, that is correct. I thought you don't want to see obs that are not contributing in merge.
... View more