Hi all
I have a problem with apostrophes!
I have a S36 file (don't ask!) with a native AS400 RPG trigger program attached to it which fires after an insert or update.
The trigger program then submits a job (using QCMDEXC), calling another RPG program and passing it the trigger buffer as a parameter.
The problem comes when one of the subfields of the trigger buffer contains an apostrophe - the SBMJOB statement fails because it interprets the apostrophe as a delimiter rather than an apostrophe.
So my idea was, in the trigger program, to scan and replace the single apostrophe with two as I've read that this is the way to get an RPG to recognise a single apostrophe.
It worked to an extent - the SBMJOB statement was successful, but by the time the data hit the second RPG program, there was only one apostrophe and all the subsequent subfields in the trigger buffer had been shunted back one, which screwed the rest of the data.
Any ideas why it is doing this?
Is there any way I can retain my apostrophe, or should I just give up and replace it with a space? The field in question is an address line, so it's quite valid for there to be an apostrophe in it...
I have a problem with apostrophes!
I have a S36 file (don't ask!) with a native AS400 RPG trigger program attached to it which fires after an insert or update.
The trigger program then submits a job (using QCMDEXC), calling another RPG program and passing it the trigger buffer as a parameter.
The problem comes when one of the subfields of the trigger buffer contains an apostrophe - the SBMJOB statement fails because it interprets the apostrophe as a delimiter rather than an apostrophe.
So my idea was, in the trigger program, to scan and replace the single apostrophe with two as I've read that this is the way to get an RPG to recognise a single apostrophe.
It worked to an extent - the SBMJOB statement was successful, but by the time the data hit the second RPG program, there was only one apostrophe and all the subsequent subfields in the trigger buffer had been shunted back one, which screwed the rest of the data.
Any ideas why it is doing this?
Is there any way I can retain my apostrophe, or should I just give up and replace it with a space? The field in question is an address line, so it's quite valid for there to be an apostrophe in it...