set Global = "^PRBS(""IP"")" for set Global = $Q(@Global) Quit:$QS(Global,1)'="IP" do . Set MPRNr = $QS(Global,3) . Set BSKey = $QS(Global,4) . If '$D(^PRBS("BS",MPRNr,BSKey)) D . . K @Global W Global_" "_$ZR,!