Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I need to create unique dataset names.

Status
Not open for further replies.

rafeaalderink

Technical User
Dec 10, 2003
2
US
Good afternoon,
I have a routine that occasionally needs to create a dataset with a unique name. I was using a combination of date and time to create a low-level qualifier for the dataset, but last week we had a problem that generated a flood of messages. With up to 8 messages a second the qualifier was not unique every time so I lost some data. The automation caught every message and everything worked fine, except that I didn't get a dataset for each message because of duplicate dataset names.

The current code:
da = date(j)
da = right(da,2)
ti = time(s)
rnum = 'X'||da||ti
dsn = "'HLQ1.HLQ2.HLQ3."rnum"'"

Any ideas how to handle this differently? I suppose I could put in a loop that would make several attempts at different names until it gets a unique one, but I'd prefer to have a formula that works the first time. For me, simpler is always my preference.

Thanks in advance for your help
Rafe Aalderink

 
Try making use of TIME(L).

say time(L)
say time(L)
say time(L)
say time(L)
exit 0
/* results */
07:03:04.987645
07:03:04.987704
07:03:04.987730
07:03:04.987753
 
Thanks. Somehow I looked at the TIME function over and over and still missed seeing that.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top