In my opinion, the easiest way is the the DEVTYPE macro.
DEVTYPE =CL8'DDNAME',OUTPUT
LTR 15,15
BZ DDOK
...
DDOK ...
...
OUTPUT DC XL16'0'
Rather than use =CL8'DDNAME' I generally point to the DD name character string in the DCB: DCBDDNAM-IHADCB+DCB.
Searching the TIOT as proposed by sergeyken is another way to do it, but it's more involved and requires a loop. The exit from the loop is not exactly obvious to a beginner, and requires rather detailed understanding of the structure of the TIOT.
Another alternative is to test the DCB after the OPEN to see if it is open.
OPEN (DCB,...)
TM (DCBOFLGS-IHADCB)+DCB,DCBOFOPN
BO DDOK
...
DDOK ...
...
The DCB symbols are all defined in the DCBD macro.
The RDJFCB macro proposed by sergeykeyn is another option, but it also requires setup that is not immediately obvious to a beginner.
RDJFCB (DCB,...)
LTR 15,15
BZ DDOK
...
DDOK ...
...
DCB DCB EXLST=XLIST,...
...
XLIST DC 0A(0),AL1(X'80'+7),AL3(JFCB)
JFCB DC XL176'0'
I've used all these methods at various times in my career; use the one that seems simpler and more understandable to you. FWIW, while I've scanned the TIOT, it has been for other reasons, not to see if a single DD is defined in it.