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?

BASUG is hosting free webinars Next up: Don Henderson presenting on using hash functions (not hash tables!) to segment data on June 12. Register now at the Boston Area SAS Users Group event page: 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.

 

 

BASUG is hosting free webinars Next up: Don Henderson presenting on using hash functions (not hash tables!) to segment data on June 12. Register now at the Boston Area SAS Users Group event page: 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

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 11 replies
  • 989 views
  • 5 likes
  • 5 in conversation