it just works as any literal.
move 'Y' to ws-y
select :ws-y from sysibm.sysdummy1
select 'Y' from sysibm.sydummy1
Your query just returns a certain grp-rule with a 'Y' and if any, all dependant contract rules of a certain contract started at a certain time with a 'N'
I'm not sure what the requirement is, but functionally you can probably do the same thing with
SELECT B.NTWRK_IND,A.GRP_RULE_ID INTO :WS-NTWRK-IND,:WS-GRP-RULE-ID:ws-grp-rule-ind
from Wgd.RULE_CNTRCT B
left join Wgd.GRP_RULE A on A.GRP_RULE_ID = B.RULE_ID
WHERE B.RULE_ID = :HS-UM-RULE-ID
AND B.CNTRCT_CD = :WS-WS-CONTRACT-CD
AND b.STRT_DT = :WS-HS-BNFT-YR-CONTR-EFF-DTE
it looks to be written before left join was implemented or understood.
I can explain it to you, but i can not understand it for you.