I am trying to use a query created database file as input for a RPG program. The database file has the following fields:
Field length
Number 7
Company 40
Country 15
Name 164
Name is a concatenation of 4 fields.
I defined the file in the RPG program as:
DFile DS
D Num 7
D Co 40
D Cty 15
D Nam 164
What I need to do is to search the Nam field for the characters 'ATTN:' or 'CONTACT:' and remove everything that preceds the ':'.
I think the SCAN command will be able to help me search the field. I've seen examples written in Free-form but not the standard form. Does anyone know how it should look like?
From what I read of the TRIM command it only removes leading/trailing blanks. Should I just Scan for the position of ATTN: and use it as the start of a SUBST?
Field length
Number 7
Company 40
Country 15
Name 164
Name is a concatenation of 4 fields.
I defined the file in the RPG program as:
DFile DS
D Num 7
D Co 40
D Cty 15
D Nam 164
What I need to do is to search the Nam field for the characters 'ATTN:' or 'CONTACT:' and remove everything that preceds the ':'.
I think the SCAN command will be able to help me search the field. I've seen examples written in Free-form but not the standard form. Does anyone know how it should look like?
From what I read of the TRIM command it only removes leading/trailing blanks. Should I just Scan for the position of ATTN: and use it as the start of a SUBST?