Current dataset in a concatenation? 
Author Message
 Current dataset in a concatenation?

If my program is reading a concatenation of datasets, what's the best
way to tell which dataset is currently being read?  I need to be able to
detect the end of one "sub-dataset" and the start of the next.

The way I'm currently doing it is by scanning through the SIOT / DSAB
chain, and finding the last DSAB for which DSABOPEN has been set.
From this DSAB I can lookup the SIOT address, and thence the JFCB
address, and find the DSN of the current dataset.

This does seem to work, but I can't help thinking that there should be a
better way.  For one thing, the above method only works when reading
the concatenation once.  (If I re-open it and read it again, the DSABOPEN
bits are all still set from last time.)

Any suggestions?  Thanks in advance.

Cheers,
Allen Gainsford



Fri, 31 Jan 2003 03:00:00 GMT  
 Current dataset in a concatenation?

said:

Quote:
>If my program is reading a concatenation of datasets, what's the best way
>to tell which dataset is currently being read?  I need to be able to
>detect the end of one "sub-dataset" and the start of the next.

In QSAM/BSAM, EOV keeps DCBTIOT in sync with the current DD.  

     GET DCBIN,INREC                   read a record
     USING IHADCB,INREC
     CLC PREVTIOT,DCBTIOT              new dd?
     BE   SAMEDD                       no, jump
     MVC PREVTIOT,DCBTIOT              yes, save TIOT offset
     L   R1,PSATOLD-PSA                TCB
     L   R2,TCBTIO-TCB(,R1)            TIOT
     AH  R2,DCBTIOT                    add TIOT offset
     USING TIOENTRY,R2
  < process new DD >
SAMEDD EQU *
  .  .  .  .  .
PREVTIOT DS H

You can also be notified of a DD switch in an EOV exit.

 Gilbert Saint-flour
 http://members.home.net/gsf/



Fri, 31 Jan 2003 03:00:00 GMT  
 Current dataset in a concatenation?

Quote:

> If my program is reading a concatenation of datasets, what's the best
> way to tell which dataset is currently being read?  I need to be able to
> detect the end of one "sub-dataset" and the start of the next.
> The way I'm currently doing it is by scanning through the SIOT / DSAB
> chain, and finding the last DSAB for which DSABOPEN has been set.
> From this DSAB I can lookup the SIOT address, and thence the JFCB
> address, and find the DSN of the current dataset.
> This does seem to work, but I can't help thinking that there should be a
> better way.  For one thing, the above method only works when reading
> the concatenation once.  (If I re-open it and read it again, the DSABOPEN
> bits are all still set from last time.)
> Any suggestions?  Thanks in advance.
> Cheers,
> Allen Gainsford

IIRC if you set the unlike concatenation bit, your DCB open exit will be called
for each dataset. RDJFCB at this point should get you the new DSN. You will
also need to re-issue the get that caused the DS switch.

        Jerry



Fri, 31 Jan 2003 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. PUSH-CURRENT and POP-CURRENT

2. good name for GET-CURRENT SWAP SET-CURRENT

3. what example would I use to measure emission current and leakage current (voltage vs. current)?

4. String Concatenation in Dolphin?

5. string concatenation

6. concatenation problem

7. Concatenation of Characters

8. Concatenation

9. string concatenation problems

10. [VW} Set concatenation

11. [VW} Set concatenation ... question explained

12. a2p syntax error on with string concatenation operator

 

 
Powered by phpBB® Forum Software