Basically you cannot do sql on a ddm file.
It's such a simple test
CRTDDMF QTEMP/MYLIB to yourself.
CRTDDMF FILE(QTEMP/MYFILE)         
        RMTFILE(SYSIBM/SYSDUMMY1)  
        RMTLOCNAME('127.0.0.1' *IP)
DSPPFM FILE(QTEMP/MYFILE)
STRSQL
select * from qtemp.myfile
SQL7011
Message . . . . :   MYFILE in QTEMP not table, view, or physical file.
It is not a comm issue, especially when going to 127.0.0.1.
However, there is an exception to the rule.  Not that you can get this ddm exception to point to a remote system though.
dltf qtemp/myfile                         
Object MYFILE in QTEMP type *FILE deleted.
STRSQL
CREATE ALIAS QTEMP.MYFILE FOR SYSIBM.SYSDUMMY1 
  Alias MYFILE created in QTEMP.                 
SELECT * FROM QTEMP.MYFILE                     
  SELECT statement run complete.                 
DSPFD QTEMP/MYFILE
  Type of file  . . . . . . . . . . . . . . . :            Device           
  Device type . . . . . . . . . . . . . . . . :            DDM              
  Auxiliary storage pool ID . . . . . . . . . :            00001            
DDM File Attributes                                                         
  File level identifier . . . . . . . . . . . :            1210311154658    
  Creation date . . . . . . . . . . . . . . . :            03/11/21         
  Remote file . . . . . . . . . . . . . . . . : RMTFILE    'SYSIBM/SYSDUMMY1
                                                                            
  Remote location                               RMTLOCNAME                  
    Name or address . . . . . . . . . . . . . :            '*LOCAL'         
    Type  . . . . . . . . . . . . . . . . . . :            *SNA             
Rob Berendt
As an Amazon Associate we earn from qualifying purchases.