You can switch to alternate and primary files using classes using the .A or the .P after the class name as shown below.
The example below is using Batch jobs. You can also switch at the CLASS level using the CA DADS online menus-transaction DADA..
//SYSIN DD *
FUNCTION=DADS,APPLID=(APPLID01,QUEUE)
REQUEST=(A,C,CLASSALT.P)
For the primary
Or
//SYSIN DD *
FUNCTION=DADS,APPLID=(APPLID01,QUEUE)
REQUEST=(A,C,CLASSALT.A)
For the alternate
…
I did the following test using a CA DADS batch job. I have two files FILE001 and FILE002 in class CLASSALT. Both files have an alternate file define in the CA DADS entry.
When I start my CICS region the files are allocated to the primary cluster name.
F:FILE001 SUPPORT.FILE001 ALA OPE ENA
F:FILE002 SUPPORT.FILE002 ALA OPE ENA
I then run a batch job. Step 1 to deallocate the class and step 2 to allocate the alternate dataset.
FUNCTION=DADS,APPLID=(APPLID01,QUEUE)
REQUEST=(A,C,CLASSALT.A)
The batch output shows
FUNCTION=DADS,APPLID=(APPLID01,QUEUE)
REQUEST=(A,C,CLASSALT.A)
CONDITION CODE=000 DADSA460 REQUEST COMPLETED SUCCESSFULLY.
Online in DADS the DADI transaction shows the two alternate files allocated.
F:FILE001 SUPPORT.FILE001.ALT ALA OPE ENA
F:FILE002 SUPPORT.FILE002.ALT ALA OPE ENA