We've already given you all the pieces, the rest is basic programming.

Use Bar, NumOpenLong and follow jcl instructions and you'll get it.