How does the TEMP library get defined? Is that done in your code or by WRDS when it creates your SAS session?
Does TEMP point to the same folder location for every SAS session? It will if you define it. If WRDS is defining it then it may or may not point to the same folder every time.
The most likely explanation for your problem is that a previous run of your program crashed leaving a rogue SAS process still locking that dataset in TEMP. Only the SAS administrators at WRDS can fix this type of problem. Is there a help desk you can log this problem with?