rafeaalderink
Technical User
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
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