Perhaps someone can help me with my problem/situation.
At my installation, we run Natural under both TSO and CICS but all online applications run under CICS. I have a Natural process (under CICS) where a user can initiate a batch process (Natural running under TSO) where they can optionally specify a TSO dataset as job input.
What I want to do in my Natural online program is to dynamically allocate this dataset as a work file (e.g. CMWKF01) only for the duration of this process. I want to ensure that the dataset exists (obviously the allocation fails if it does not exist) and trap allocation failure this to send an appropriate message to the screen via REINPUT.
If the dataset does exist, I want to determine the number of records in the file and take some action, depending on the number of records. In my case, if there are more than 200 records the batch job will be submitted for overnight processing, otherwise it will be submitted for immediate processing.
Anyone here done something similar and would be willing to share?