- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi All,
Help me to Solve below Syntax error,
Data dirlist3;
Set Dirlist2 ;
command="x 'copy "||'"'||strip(file_loc)||'" "||'"'||strip(file_to)||'"||"';";
call execute(command);
Run;
Log Says :
685
686 Data dirlist3;
687 Set Dirlist2 ;
688 command="x 'copy "||'"'||strip(file_loc)||'" "||'"'||strip(file_to)||'"||"';";
----------------------
22
ERROR 22-322: Syntax error, expecting one of the following: !, !!, &, *, **, +, -, /, <, <=, <>, =,
>, ><, >=, AND, EQ, GE, GT, LE, LT, MAX, MIN, NE, NG, NL, OR, ^=, |, ||, ~=.
689 call execute(command);
690 Run;
Your Will appreciate. thanks In advance.
Regards,
Dishant Parikh
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
="x 'copy "||'"'||strip(file_loc)||'" "'||strip(file_to)||'"'||" ';" ;
I think at this they are placed syntax correct. Probably you are needing a restart of the sas-session when you can not get out of the nesting issues.
The "magic string" could help you also. When using Eguide you will see that often as some start code.
You are trying to build an OS command. The call system interface it the one you could use within the datastep
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
you have several unbalanced apostrophes ' " in you statement causing the language interpreter going crazy. The first is after strip_loc.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Jaap,
Can you please provide me Correct Syntax for above problem,because statement causing the language interpreter going crazy for me as well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Thanks For your help,Problem solved
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
="x 'copy "||'"'||strip(file_loc)||'" "'||strip(file_to)||'"'||" ';" ;
I think at this they are placed syntax correct. Probably you are needing a restart of the sas-session when you can not get out of the nesting issues.
The "magic string" could help you also. When using Eguide you will see that often as some start code.
You are trying to build an OS command. The call system interface it the one you could use within the datastep
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Just to add as I run into these quotes all the time, there are functions out there to help reduce the complexity of the code. For example:
options xwait;
data tmp;
attrib command format=$2000.;
dir="s:\temp\rob\tmp.csv";
dir2="s:\temp\rob\xx";
command="x 'copy "||quote(dir)||" "||quote(dir2)||"';";
call execute(command);
run;