z/VM

 View Only

 CPFMTXA in batch

Amr Mahdi's profile image
Amr Mahdi posted Wed May 14, 2025 02:32 AM

Hi,

We've the need to use CPFMTXA in ZVM 7.4 to format multiple DASD drives. how can we execute the CPFMTXA in batch or in script writing all parameters and prompts?.

Regards

Amr Mahdi 

Romney White's profile image
Romney White

Amr:

One way to do this is to stack all the responses that CPFMTXA is expecting and then invoke the command. For example, I use this EXEC to define and format a paging volume for a second-level z/VM:

/* */                                      

Parse Arg size                             

If size = ''                               

 Then size = 100                           

'CP DETACH 940'                            

'CP DEFINE T3390 940' size                 

If RC <> 0                                 

 Then Exit RC                              

user = USERID()                            

Queue 'YES'                                

Queue 'PERM 0 0'                           

Queue 'PAGE 1' (size-1)                    

Queue 'END'                                

'EXEC CPFMTXA 940 XAPAGE'                  

'EXEC CPFMTXA 940 XAPAGE OWNER VMPLEX.'user

Romney White, IBM

Amr Mahdi's profile image
Amr Mahdi

Thanks Romney.. It works perfectly