Here's a method I use to determine the highest datasession number--the algorithm looks something like this:
FOR i = 1 TO
SET DATASESSION TO &i
check if an error occurred
if no error occurred
i is now the highest known datasession
endif
ENDFOR
If you want to know how many datasessions exist rather than the highest number, just change the logic to count rather than find the high datasession id.
The art here is guessing how high to set so you don't miss any datasessions balanced against the time it takes to check each one (you don't want to check all 32K of the possibilities). I just pick some reasonable number, but you could also develop more sophisticated logic, such as: keep checking datasessions until you find 10 (or whatever) sequential unused datasessions.
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only