Search for missing Semi-colon in Free format

Is there a way in either SEU, Code400 or the LPEX editor to do a search by exclusion? I'm looking for an easy way to identify lines of code, in Free format, that are missing the semi-colon at the end.

Answer Wiki

Thanks. We'll let you know when a new response is added.

You can override the source file to the source file and member and then use the following SQL statement:

SELECT SRCSEQ, SRCDTA FROM qrpglesrc WHERE srcdta not like ‘%;%’

This will show all lines in the source that do NOT have a semicolon in them. Including comments and continued lines. You could exclude these as well but you might miss the line you are looking for.

Discuss This Question: 7  Replies

There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • TomLiotta
    Free-form source lines can contain just about anything. If a previous line continues a literal, it can be 'literally' anything. Therefore, actual syntactic processing is necessary if you want certainty. Unfortunately, there is no point in running a test for missing semi-colons if the syntax is correct -- there wouldn't be any missing semi-colons. So, it's kind of a Catch-22. You want code as simple as possible, but it has to be smart enough to do what the compiler cannot do. You want a program to tell you "A semi-colon should be here." If that was easy, there wouldn't be a requirement to have semi-colons. The compiler could simply assume the existence. Tom
    125,585 pointsBadges:
  • WoodEngineer
    If you have a chance, try WDSc / RDi when developing your code. It warns immediately of missing semi-colons. That is immediately after pressing the Enter on a line of code. Its really cool.
    8,245 pointsBadges:
  • Teandy
    What version of the O/S are you on. I am at V5R4 and when I code in SEU and am missing a semi-colon, the editor highlights the line below and throws an error. Are you trying to come up with something that will find this in some sort of batch process?
    5,860 pointsBadges:
  • Cwc
    I doubt the original poster is still looking for answers to this, as this was a three year old question, along with many others that have been getting resurrected.
    4,290 pointsBadges:
  • TomLiotta
    this was a three year old question IMO -- This is also intended to be a Wiki site, described as the "Answer Wiki". As such, whenever a new perspective is found, the articles should be updated. Discussion shouldn't end just because those who see an item this month can't think of appropriate responses. Someone will have a similar problem three years later and may go searching. Someone else might have had a brilliant idea just last week. Keeping issues in mind helps spur comments that may help everybody. As important as it might be to provide an appropriate answer as soon as the question is asked, it's probably more important to put some effort into ensuring that correctness, completeness and relevance are part of every item regardless of age. The discussions are not just for the OP. They're for everyone who ever visits the page any time in the future. Again, that's only "IMO". I'd like to increase the value of every i-related site I can think of. Tom
    125,585 pointsBadges:
  • Labnuke99
    TomLiotta - I agree with you. This should be a "living" site with updates and historical references. This is what learning and technical support is all about. Learn from other people's mistakes and use the knowledge gained to improve support.
    32,960 pointsBadges:
  • ITKE
    I think the goal is similar to what Tom and Troy mention. Although the original poster may be long gone. We get a lot of people to old questions looking for answers to a problem that is new to them so adding "value" to old questions is a good thing especially if someone is searching for a solution for the first time. Thanks Sean Community Leader
    1,160,680 pointsBadges:

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.


Share this item with your network: