View previous topic :: View next topic
|
Author |
Message |
emir_soko
New User
Joined: 10 Mar 2022 Posts: 8 Location: Germany
|
|
|
|
Hey guys, I am making this program in rexx in which I allocated specific ds with mbr, I read all data to stem and now I have to print out those error warnings and severe messages that compiler returns.
Data is huge eg 5-10k of lines but compiler messages are somewhere in the middle and they all start with IBM????I (e.g. • IBM1043I I)
How can I exclude all lines that are not interesting for me?
Thank you for any help
Code: |
/*REXX*/
INPUT = 'DATASET(MEMBER)'
ADDRESS TSO
"ALLOC F(INPUT) DA('"INPUT"') SHR REUS"
RETC = RC
IF RETC > 0 THEN DO
CALL ENDE( 0 "ERROR ON ALLOC INPUT="INPUT" RETC = "RETC )
END
"EXECIO * DISKR INPUT ( FINIS STEM LINE."
SAY RC
SAY INLINE.0
DO I = 1 TO INLINE.0
SAY I INLINE.I
END
|
|
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2154 Location: USA
|
|
|
|
You must present here the exact copies of all involved stuff:
1) your code (already done).
2) (a fragment of) your input data.
3) (a fragment of) your output data.
4) all error messages exactly as they are, and wherever they have appeared.
In order to exclude unneeded lines, you must understand exactly: what needs to be excluded? Then use the REXX IF statement to verify if a particular line needs to be included/excluded, and then execute/skip the corresponding SAY statement.
I would also recommend you to train yourself in accurate coding of the program, including proper code alignment, using spaces to emphasize the code elements/keywords/separators, use appropriate variable naming convention, etc. etc. etc. |
|
Back to top |
|
|
emir_soko
New User
Joined: 10 Mar 2022 Posts: 8 Location: Germany
|
|
|
|
First of all here is only fragment of input there is much more but focus is on those W messages,
Code: |
15655-PL5 IBM(R) Enterprise PL/I for z/OS /*** TAISII - P1KDI40
- SQL Preprocessor Messages
0 Message Line.File Message Description
0 IBM3250I W 281.0 DSNH204I DSNHANAL LINE 281 COL 1 STATEMENT
REFERENCES UNDECLARED TABLE "TZT"."VTZAAI"
IBM3250I W 296.0 DSNH204I DSNHANAL LINE 296 COL 1 STATEMENT
REFERENCES UNDECLARED TABLE "TZT"."VTZAAI"
IBM3250I W 324.0 DSNH206I DSNHANAL LINE 324 COL 1 STATEMENT
REFERENCES COLUMN "AI"."AI", WHICH IS NOT DEC
IN THE SPECIFIED TABLE(S)
IBM3250I W 324.0 DSNH206I DSNHANAL LINE 324 COL 1 STATEMENT
REFERENCES COLUMN "AI"."ZI", WHICH IS NOT DEC
IN THE SPECIFIED TABLE(S)
IBM3250I W 324.0 DSNH206I DSNHANAL LINE 324 COL 1 STATEMENT
REFERENCES COLUMN "AI"."SNR", WHICH IS NOT DE
IN THE SPECIFIED TABLE(S)
IBM3250I W 324.0 DSNH206I DSNHANAL LINE 324 COL 1 STATEMENT
REFERENCES COLUMN "AI"."LFEAI", WHICH IS NOT
DECLARED IN THE SPECIFIED TABLE(S)
IBM3250I W 324.0 DSNH206I DSNHANAL LINE 324 COL 1 STATEMENT
REFERENCES COLUMN "AI"."LFEAI", WHICH IS NOT
DECLARED IN THE SPECIFIED TABLE(S)
IBM3250I W 339.0 DSNH206I DSNHANAL LINE 339 COL 1 STATEMENT
REFERENCES COLUMN "AI"."AI", WHICH IS NOT DEC
IN THE SPECIFIED TABLE(S)
IBM3250I W 339.0 DSNH206I DSNHANAL LINE 339 COL 1 STATEMENT
REFERENCES COLUMN "AI"."ZI", WHICH IS NOT DEC
|
and the output is basically the whole member printed in output so I have to force close it using "HI" |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2154 Location: USA
|
|
|
|
Code: |
. . . . . . . . .
Parse Var INLINE.I =2 TextLine
Parse Var TextLine MsgID MsgType .
If Left( MsgID, 3) = 'IBM' ,
& Right( MsgID, 1) = 'I' ,
& MsgType = 'W' Then Iterate I /* skip unneeded line */
. . . . . . . . . .
|
I recommend you to train yourself in detection the "continuation lines" of those error/warning messages. (To allow you doing a part of your job by yourself).
This depends on the samples for the rest of your input data, which you decided not to show to the forum. Anyway, nobody can do it except yourself.
P.S.
It might be easier to detect the needed lines, rather than unneeded ones. |
|
Back to top |
|
|
Willy Jensen
Active Member
Joined: 01 Sep 2015 Posts: 740 Location: Denmark
|
|
|
|
Even assuming that you have an internal procedure 'ENDE', you must change the following
CALL ENDE( 0 "ERROR ON ALLOC INPUT="INPUT" RETC = "RETC )
to
CALL ENDE 0 "ERROR ON ALLOC INPUT="INPUT" RETC = "RETC
Paranthesis are for function invocations.
And you dont need the statement in a DO/END block so you really only should have:
IF RC>0 THEN CALL ENDE 0 'ERROR ON ALLOC INPUT='INPUT 'RC="rc |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2598 Location: Silicon Valley
|
|
|
|
You have only shown a part of the file. From what I see, I would do it differently. Instead of searching for IBM*****, I would search for "- SQL Preprocessor Messages" and then print any lines that follow. But you did show us what follows that section. I presume that there is some kind of section title that when you find it will stop the printing of lines.
The section that you showed only has errors in SQL statements.
After that section, there might be other IBM**** messages related to PLI errors. |
|
Back to top |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1205 Location: Dublin, Ireland
|
|
|
|
This thread should be moved to the Beginners Forum.
Garry. |
|
Back to top |
|
|
prino
Senior Member
Joined: 07 Feb 2009 Posts: 1316 Location: Vilnius, Lithuania
|
|
|
|
There's this utility called SuperC... |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2154 Location: USA
|
|
|
|
prino wrote: |
There's this utility called SuperC... |
Quote: |
We're not looking for easy ways |
|
|
Back to top |
|
|
|