On 16-Dec-2014 12:40 -0600, Bill Howie wrote:
On 16-Dec-2014 11:00 -0600, CRPence wrote:
On 16-Dec-2014 07:11 -0600, Bill Howie wrote:

I'm trying to work through creating my first REXX program on the
AS/400 and I'm getting a very generic error that I'm trying to
figure out. Here are the first two lines of my code:

delim = ','
'OVRDBF FILE(STDIN) TOFILE('TEST'/'TESTRAWJRN') MBR('TESTNONJRN')'

No matter if I have either of these lines as my first line, I
get this error either way:
"Error in line 1: Invalid character in program"

I can't seem to find anything online about what might cause
this. Wondering if we have any REXX gurus out there who might
lend assistance. Please advise. Thanks!


The preferred string delimiter for the EXEC *COMMAND environment is
the double-quote character, not the apostrophe character. And if
using apostrophes, then be sure [like in most situations] the
character is properly escaped.

The desired command string is presumably properly effected with the
following request [assuming the defaults for the unspecified
parameters are expected, notably the Override Scope (OVRSCOPE),
and the environment is the *COMMAND]:

"OVRDBF FILE(STDIN) TOFILE(TEST/TESTRAWJRN) MBR(TESTNONJRN)"

Note how there is no requirement to place delimiters [neither
apostrophes nor double-quote characters] around the names in
command string.


Want to make sure I'm understanding what you're saying.......the two
lines I've shown are within a REXX program. It seems you're thinking
I'm doing this on the command line? Or maybe I'm misunderstanding.

The two lines were understood to be two REXX source statements. The first an assignment of a REXX variable to the value of a string of the one character, a comma.

Also, the delim = ',' statement has to do with something later on in
the program. I'm not using it as some sort of delimiter for the
OVRDBF command.

That is understood. Sorry, I had chosen to ignore the error message "Invalid character in program" in my original reply; choosing to comment only on how the command-string was composed, and to suggest the preferred means to compose the command-string. As such, I should have trimmed the OP to show only the REXX source line that was apparently intended to be sent to the COMMAND environment.

Those just happen to be the first two statements in my program, and I
was getting the aforementioned error message when either one of them
was the first line executed.

Hopefully I'm understanding your info correctly. Thanks!


With regard to the error message "Error in line 1: Invalid character in program" that was described in the OP, that error is consistent with a non-displayable or otherwise extraneous [minimally non-alphanumeric] character being recognized as invalid within a REXX statement source. The implication of the error message text is that extraneous character(s) appear on the line being diagnosed with the error; character(s) that are not valid in a REXX source statement.

What was given as the "two lines" of text should *not* have exhibited the noted error message. Yet what was copied into the OP may not have been exactly what exists in the source physical file member; whatever copy\paste or other means was used to imply what was presented as the actual source-line in whatever unstated interface [5250 or otherwise], may not be a proper representation of that line of source within the actual PF-SRC Member.

The Display Physical File Member (DSPPFM) command allows a Hex view of the character data in the source physical file member for the REXX Source; ensure there are no characters beyond the REXX statements, other than 0x40 [EBCDIC blank\space] characters.

The possibility exists to add a new [empty] source member and then type just those two REXX statements into the source using Start Source Edit Utility (STRSEU). If that version of the source is acceptable, i.e. is interpreted without errors, then replace the first two lines of the problematic source with the two lines of the new\functional source; e.g. using the Browse\Copy Member feature of SEU.


This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2019 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].