what have you tried? There is a whole suite of SQL functions for cicode I have used extensively in the past. There are good examples in the cicode reference docs online or in paper if you have the cicode programming reference doc.
What exactly are you having trouble with