BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
mrzd
Calcite | Level 5

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!

1 ACCEPTED SOLUTION

Accepted Solutions
Peter_C
Rhodochrosite | Level 12

so, guess the correct answer is:

no

View solution in original post

8 REPLIES 8
mrzd
Calcite | Level 5

by the way, we have a Unix envt. :smileylaugh:

Peter_C
Rhodochrosite | Level 12

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.

Tom
Super User Tom
Super User

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.

LinusH
Tourmaline | Level 20

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

Data never sleeps
mojerry2
Fluorite | Level 6

Hi,

No, pid is certainly not unique Smiley Wink 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...

Peter_C
Rhodochrosite | Level 12

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

Peter_C
Rhodochrosite | Level 12

so, guess the correct answer is:

no

mrzd
Calcite | Level 5

I see. Thanks for the help guys, as well as for the tips. Smiley Happy

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

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
  • 8 replies
  • 2373 views
  • 3 likes
  • 5 in conversation