Hello All,
I'm trying to extract data between two characters.
Example XXX.XXXX_
I'm able to extract the first part of the string its the second part (.XXXX_ ). In my example I can extract if the characters are there but not all will have a character at the end. Some have them for character fill in. So the code that doesn't have a character at the end I get an error message.
Here is my code so far.
whileprintingrecords;
numbervar v_firstdash;
numbervar v_secondunderscore;
v_firstdash := instr({Budget.Group2},"-");
v_secondunderscore := instr(mid({Budget.Group2},v_firstdash + 1),"_");
mid({Budget.Group2},v_firstdash + 1, v_secondunderscore - 1)
I'm trying to extract data between two characters.
Example XXX.XXXX_
I'm able to extract the first part of the string its the second part (.XXXX_ ). In my example I can extract if the characters are there but not all will have a character at the end. Some have them for character fill in. So the code that doesn't have a character at the end I get an error message.
Here is my code so far.
whileprintingrecords;
numbervar v_firstdash;
numbervar v_secondunderscore;
v_firstdash := instr({Budget.Group2},"-");
v_secondunderscore := instr(mid({Budget.Group2},v_firstdash + 1),"_");
mid({Budget.Group2},v_firstdash + 1, v_secondunderscore - 1)