I want to create unique numbers with an AP REXX program?
search cancel

I want to create unique numbers with an AP REXX program?

book

Article ID: 39441

calendar_today

Updated On:

Products

Automation Point

Issue/Introduction

This article concerns the creation of unique numbers with AP REXX programs. I have a REXX routine that builds a UNIQUE file that it will write to and then process. The problem is, that this routine can be called more than once simultaneously and the file gets overwritten. How do I make sure that every time the REXX runs, it generates a unique filename?

Environment

Windows Server, Open Object REXX

Resolution

Since your REXX routine can be called more than once simultaneously, I suggest that you use the SysQueryProcess(PID) utility which is available in Open Object REXX. Using this utility, you will get the process ID for each running REXX routine that you call. Your filenames can then be concatenated with this PID, which will be unique, especially when the routine is called more than once simultaneously.