Hi!
We plan to use the &sysjobid macro variable as an id for our historical tables to indicate uniqueness of data batches. Is it possible to recur?
Thanks for the help!
by the way, we have a Unix envt. :smileylaugh:
in SAS on unix the sysjobID is filled with the PID (the process ID) value. It will _very_ probably be unique. I cannot imagine how it would not be unique.
I am not sure the &SYSJOBID will be unique over time so that you could use it as a historical reference. I know that on Unix it will restart the process id numbers when the server reboots. They might even cycle around if you run the server long enough. Also what if your jobs are distributed across servers.
Agree with Tom, the pid is not unique over time.
So you probably have to create your own id. Or, why not use a timestamp, that should be unique in most applications?
/Linus
Hi,
No, pid is certainly not unique otherwhise after a while your server can't run any process because the pid is full...
you could use a reference table who logs your id and each time you want to create a new one select max+1 and the jobname.
other possiblity is jobname+datetime.
date is not enough, you could run twice the same day your process. never say never...
as we use more parallel processing like grid, we will increase the number of ways similar tasks might start at the same time.
However, a consistent hash of server address and timestamp and process id + perhaps a 6-digit random number, might generate a unique id
so, guess the correct answer is:
no
I see. Thanks for the help guys, as well as for the tips.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.