>>How do you have you program check how many datasessions are open at the time your program is running. Specifically when you want to use Datasession 2 if and when it is available.
>>
>>Thanks.
>
>There is no native functions like ADATASESSIONS(). AFAIK, the only way to do this is loop through all reasonable datasession numbers, trying to SET DATASESSION to that datasession, and trapping for the error if the datasession is invalid.
Oh, there is. What do you think where does the combo in the Set (aka View, aka Data Session) window get populated from? Just create three forms with private DSes, suspend and SET - and the top combo will be showing four data sessions (the default and the three new ones).
It's just that the function was not made known to us mortals, just like the function which would know the next fopen() handle number, or some other things you can click on anytime you like, but you can never code'em. Hmmm, sounds like a good tagline :)