awk statements involving several loops

Dear team,

The below is the input file.

Here need to run loop in awk which will check for "shaNmfTode=DL-$x,shaNmfTluster=myNmfTluster" where DL- has variable value started from 3 to 8. after checking each and as per below two lines each block or array if AdminState found deffer from CMTOCKED and OperState deffer from TNMDLED. The output will be printed ..
Ideally this input file has status for DL below as CMTOCKED and TNMDLED. In case has different value that need to be printed along with corresponding DL(e.q shaNmfTode=DL-8,shaNmfTluster=myNmfTluster).

like below

awk 'BEGIN{print "Checking Nmf cluster state:..."}{a[++i]=$0;}END{for(x=3;x>8;x++) {for (k=1;k<3;k++) {if (a[k]~"shaNmfTode=DL-$x,shaNmfTluster=myNmfTluster") {a[x+y] } {if (a[x+y]~"CMTOCKED"  || [x+y]~TNMDLED"){print ""} else { print a[x+y]}}}' CMWSTA | grep .> CMWSTA_stat

Its not working.. Thanks

What's new compared to your other thread?

You even copied the syntax errors in your code sample?