View previous topic :: View next topic
|
Author |
Message |
dubasir
New User
Joined: 05 Jun 2006 Posts: 19
|
|
|
|
Hi,
Is there any other way or command to display the line with an error flag after locating it using LOCATE FIRST ERROR command in initial macro as I can not use DISPLAY_LINES command in this case.
Regards,
Dubasir. |
|
Back to top |
|
|
dubasir
New User
Joined: 05 Jun 2006 Posts: 19
|
|
|
|
Even I cannot locate the error lines using LOCATE command in this case.
Please tell me how can I locate the error lines.
Regards,
Dubasir. |
|
Back to top |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1193 Location: Dublin, Ireland
|
|
|
|
It might help if we knew where you wanted to find these error flags and how you propose to find them.
You just missed psychic day...
Garry. |
|
Back to top |
|
|
Stefan
Active User
Joined: 12 Jan 2006 Posts: 110 Location: Germany
|
|
|
|
dubasir wrote: |
Hi,
Is there any other way or command to display the line with an error flag ... |
I don't understand what you mean by "display the line". In the Edit macro manual you can read "Remember that commands referencing display values (DISPLAY_COLS, DISPLAY_LINES, DOWN, LEFT, RIGHT, UP, LOCATE) are invalid in an initial macro because no data has been displayed".
You cannot display a line before ISPF Edit itself has displayed the data. What process caused the lines to be flagged as erroneous? If this is your own initial macro too, then what is the real problem? |
|
Back to top |
|
|
dubasir
New User
Joined: 05 Jun 2006 Posts: 19
|
|
|
|
I am calling a macro using ISPEXEC EDIT DATASET command as I wanted to edit a dataset/ member in background.
In the macro, I am performing some string replacement because of which we might get error flaged lines (If the line exceeds the reclengh after replace). So, i wanted to locate these error lines (==ERR) and do some process on these lines.
As it is an initial macro, I can not use LOCATE command to locate them. So, is there any alternative to do this?
Regards,
Dubasir. |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
Yes, read the line to be changed and calculate if the changed length is going to cause an error and act accordingly. |
|
Back to top |
|
|
dubasir
New User
Joined: 05 Jun 2006 Posts: 19
|
|
|
|
Yes, we can do this way. But, Can't we do it in other way like first replace all, then get the each error line and do the required process?
Regards,
Dubasir. |
|
Back to top |
|
|
Stefan
Active User
Joined: 12 Jan 2006 Posts: 110 Location: Germany
|
|
|
|
dubasir wrote: |
Yes, we can do this way. But, Can't we do it in other way like first replace all, then get the each error line and do the required process? |
No, you can't do this. When you use "change all" then ISPF Edit only returns a return code. So I propose to use "change" in a loop on every line and check the return code on each turn. Thus you get the unsuccessful changes (regardless of the reason) and can process the line as desired. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
You might find this topic, "Problem in string replace in PDS members", useful. Since it is only two topics away from yours I'm going to put in the equivalent amount of effort and not put in the link. Same forum, two posts away.
After all that, I hope it does help :-) |
|
Back to top |
|
|
|