I would like to submit the same .sas job iterating over an argument, but I would like job only to be submitted after the previous is completed. Here is my attempt:
#!/bin/ksh export weeks="1 2 3" for week in $weeks do sas -log job$week.log job.sas > /dev/null & pid_ind=$! wait $pid_ind echo "job complete for week $week" done
This results in all the jobs being submitted almost at once, and then they sit in the queue. Can anyone elaborate on the 'wait' command? I am trying to hold off submission until the previous SAS job was completed, not submitted.