txt = 'ITCSUN.PLF(AITCC02)'; e_ptr=INDEX(txt,'('); finds the column position of the first '(' n_job=SUBSTR(txt,1,e_ptr-1); sets n_job to the string starting from 1 to the column position of '(' - 1. So n_job is now 'ITCSUN.PLF' n_job=COMPRESS(n_job,'.'); removes '.' from n_job, so n_job is now 'ITCSUNPLF' And you're formatting n_job as $CHAR8., so n_job *appears* as ITCSUNPL If you want to retain only the text preceding the '.', consider using the SCAN function instead. If what you want is 'ITCSUN', then all of that can be simplified as n_job=scan(txt,1,'.'); Consider removing or commenting out your format statement until you get the data transformation code debugged. In fact I doubt you need the format statement at all.
... View more