BookmarkSubscribeRSS Feed
milts
Pyrite | Level 9

 

Hi,

 

This is in reference to my previous question which has been resolved to use systask to execute a python script

 

https://communities.sas.com/t5/Base-SAS-Programming/Quoting-on-SYSTASK-command/m-p/340337#M77770

 

 

%let command = activate &python_env %nrstr(&&) python %nrquote(""%trim(&python_script_path)\load_data.py"") %nrquote(""%trim(&source)"") %nrquote(""%trim(&target)"")  2> %nrquote(""&logfile..log"");

systask command "&command" wait status=taskrc;

 

 

While the double double quote is able to successfully execute the python script, I get this note:

 

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.

49: LINE and COLUMN cannot be determined.

 

Data is loaded successfully but I get an error due to this problem. Strange that the SAS log says that this is an error when it's a note.

 

Any help or enlightenment would be greatly appreciated. Thank you!

 

Thanks!

 

 

6 REPLIES 6
Shmuel
Garnet | Level 18

I know this note for a long time and ignored it without any issues.

Anyway, if you need double-double-quotes, do not insert a blank between them.

 

What kind of error you got? Is there another message?

A note may result in return-code 4 instead 0.

That may be resolved as "error" in unix/linux script running.

RW9
Diamond | Level 26 RW9
Diamond | Level 26

Not really on topic, but would:

data _null_;
  command=catx(' ',"activate &python_env.",'&&',quote("&python_script_Path.\load_data.py"),quote("&source."),quote("&target."),'2>',quote("&logfile.")); 
  call execute(cat('systask ',command,' wait status=taskrc;'));
run; 

Not be simpler?

milts
Pyrite | Level 9

This partially solved my problem totally not off topic and thanks for the suggestion.

 

As a workaround I had to put the resolving command to a batch file and let systask execute it. 

 

data _null_;
	file "&path.\&job..bat";
	length command $ 1000;
	command=<catx portion>; 
	put command;
run; 

/* execute generated batch job script */
systask command "&path.\&job..bat" wait taskname=&taskname status=taskrc;

 

 

Astounding
PROC Star

Worth a try, that's the only way to tell:  Inside a quoting function, some characters (quotes included) can be preceded by a %.  Wherever you have:

 

""

 

Try replacing it with:

 

%"%"

ballardw
Super User

@milts wrote:

 

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.

 

 

Data is loaded successfully but I get an error due to this problem. Strange that the SAS log says that this is an error when it's a note.

 


Be very aware that was not an error is is a NOTE.

Currently SAS uses three constructs with a quote followed by a character that I am aware of currently for date, time and datetime literals such as '01JAN2017'D or "12:15:23"t. The note is warning that at some unspecified time in the future the specific string that you are creating with a  value like 'sometext'q might start being interpretted in a different fashion if SAS adds a new data literal or implied function or whatever. So they are suggesting that it might be a good idea to use 'sometext' q instead (with a space before the q)

mkeintz
PROC Star

This is all conjecture, but I'd be interested if my suggestion at the end works.

 

I believe this note came in about the time that name literals (e.g. allowing  'gdp_growth%'n and "gdp_growthpct"n as valid varnames) were introduced.

 

I guess this is because SAS wanted to reserve the possibility of adding other types of "quote-literals" to the current set (i.e. '01jan1060'd for dates, '12:00:00't for times, '01jan1960:08:45'dt for datetimes, and 'xxx'n for names).

 

Did you try the suggestion in the note, i.e. following the double-double quotes with a blank (possibly only the "closing" double-double quotes need to be followed by a blank).

--------------------------
The hash OUTPUT method will overwrite a SAS data set, but not append. That can be costly. Consider voting for Add a HASH object method which would append a hash object to an existing SAS data set

Would enabling PROC SORT to simultaneously output multiple datasets be useful? Then vote for
Allow PROC SORT to output multiple datasets

--------------------------

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 6 replies
  • 1551 views
  • 2 likes
  • 6 in conversation