SAS Programming

DATA Step, Macro, Functions and more
BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
FelixSta20
Obsidian | Level 7

I am using  command

x "notepad.exe aaa.txt";

in SAS data step. 

In win10 it ws working. In win11 it gives error

The process cannot access the file because it is being used by another process

How to make it working

1 ACCEPTED SOLUTION

Accepted Solutions
FelixSta20
Obsidian | Level 7

Occasionally I hafe found solution for my particular case. I was using command 

 x "notepad.exe uja011.sas";

for some reason exactly that format was working in previous version of windows 

Now the following works

 x "notepad uja011.sas";

So I don't know why , but it works and for time being it is enough for me to know the working format.

Thank you to all replying to my post.

 

View solution in original post

11 REPLIES 11
Quentin
Super User

If you remove SAS from the process, and submit that command on a command line, does it work?

The Boston Area SAS Users Group is hosting free webinars!
Next up: SAS Trivia Quiz hosted by SAS on Wednesday May 21.
Register now at https://www.basug.org/events.
FelixSta20
Obsidian | Level 7
Yes on command line command notepad.exe works

Quentin
Super User

What about the command:

notepad.exe aaa.txt

?

 

(Perhaps with a path to the text file, otherwise windows is probably assuming it's in the current directory, or some-such.

 

Basically I would try to get to the point where the exact same command works from command prompt, but doesn't work from SAS with the X statement.

 

 

The Boston Area SAS Users Group is hosting free webinars!
Next up: SAS Trivia Quiz hosted by SAS on Wednesday May 21.
Register now at https://www.basug.org/events.
Kurt_Bremser
Super User

Do you have the necessary maintenance level of sas for Windows 11 (9.4 TS1M7)?

What happens if you try to open the same file with a manually started Notepad while the SAS session is still running?

Is the file aaa.txt created through SAS code in the same session? If yes, post the complete log from the creation of the file up to the X statement.

FelixSta20
Obsidian | Level 7
The operation was canceled by the user.
MPRINT(COPY_MOD_STEP): x "notepad.exe uja011.sas";
MPRINT(COPY_MOD_STEP): run;
MLOGIC(COPY_MOD_STEP): Ending execution.

The operation was canceled by the user.
172 x "notepad.exe uja011.sas"
172! ;
FelixSta20
Obsidian | Level 7

Occasionally I hafe found solution for my particular case. I was using command 

 x "notepad.exe uja011.sas";

for some reason exactly that format was working in previous version of windows 

Now the following works

 x "notepad uja011.sas";

So I don't know why , but it works and for time being it is enough for me to know the working format.

Thank you to all replying to my post.

 

fja
Lapis Lazuli | Level 10 fja
Lapis Lazuli | Level 10

Glad that it works for you now. May I suggest sparing a like for those having lent a helping hand? ... Just a thought to keep people motivated. 🙂

--fja

FelixSta20
Obsidian | Level 7
Yr right
Tom
Super User Tom
Super User

I suspect the difference is really that in the mean time you closed the other program than had the SAS file open.  That is what your original error message was about.  Perhaps you were trying to edit the program you were running?

FelixSta20
Obsidian | Level 7
No quite so. In fact main SAS program creates new semidocumented sas fileas copy of one previous, and opens it for additional editing of documenting part, after closing the main SAS program continues and ends succesfully. This is to keep documented set of programs, which are later listed in special HTML summary file

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

Register now!

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
  • 11 replies
  • 2364 views
  • 5 likes
  • 5 in conversation