BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
hellohere
Pyrite | Level 9

Running loops which take hours to finish. The  window/panel is freezed, which is not big deal. 

But like to check out some datasets in between to fathom any possible scenario. 

 

How to do? Just sleep(3*60*1000) alike is fine?!

1 ACCEPTED SOLUTION

Accepted Solutions
quickbluefish
Barite | Level 11
If you are trapped in a GUI, you need to either submit the job in batch mode (ideally) or possibly open up another instance of whatever you’re using and do your other work there. If you’re submitting the job through a terminal, you just need to run it in the background - the reason your screen is frozen is because it’s running in the foreground.

View solution in original post

16 REPLIES 16
quickbluefish
Barite | Level 11
If you are trapped in a GUI, you need to either submit the job in batch mode (ideally) or possibly open up another instance of whatever you’re using and do your other work there. If you’re submitting the job through a terminal, you just need to run it in the background - the reason your screen is frozen is because it’s running in the foreground.
hellohere
Pyrite | Level 9

How to submit the job in batch mode/Windows PC?

Say my code is LoopIt.sas

Ksharp
Super User
"D:\SASHome\SASFoundation\9.4\sas.exe" -sysin "c:\temp\temp.sas" -log "c:\temp\temp.log"
quickbluefish
Barite | Level 11

If you're on Windows, yes.  Obviously, adjust the paths as needed for both the sas.exe file and your program.  Are you using SAS EG?  Studio?  Something else?  

 

Also, are you simply trying to do other work in SAS while your program is running, or are you actually trying to look at the files being generated by this loop while the program is running?  If you're trying to look at the files being generated by the loop while the program is running, and those files are temporary (i.e., in WORK), you will have to figure out where WORK is located on your file system and then proceed with caution in actually opening those files.  Don't try to open anything that has an extension like ".lck"

hellohere
Pyrite | Level 9

The original codes takes lots of datasets at WORK directory.

 

I bet need additional codes to re-generate those datasets, if to run at batch mode, right?! 

ballardw
Super User

Something you might consider would be sharing an example of your code and/or describe what you program is doing in some detail. Often people less familiar with SAS will try to force an approach to some tasks that better done using other procedures in SAS.

Also "loops" and "files" in the same phrase could mean that you are doing a lot of disk IO that may not exactly be needed with a different approach.

hellohere
Pyrite | Level 9

too many sas code files. Sometime even myself losts track of what each part does. THanks,  though. 

andreas_lds
Jade | Level 19

Please post the code "taking hours to finish". Recent versions of SAS Enterprise Guide don't freeze while executing code, which client do you use?

hellohere
Pyrite | Level 9

I am using PC SAS. The code files invoke lots of PROC SGPLOT, thousands if exactly.

THe panel keeps freezed even hours after the code files all finish sucessfully [the output pic files have info on filenames to tell].

hellohere
Pyrite | Level 9
Spoiler
just regular SAS foundation?!
hellohere
Pyrite | Level 9

Thanks erveryone. I do ran it at BATCH mode now, though still alot to catch up. 

 

Any SAS PDF/DOC on btach mode, specially for any possible pitfalls?!

Catch up on SAS Innovate 2026

Dive into keynotes, announcements and breakthroughs on demand.

Explore 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
  • 16 replies
  • 1502 views
  • 1 like
  • 7 in conversation