MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Edit command to create MSG text in prefix area
Goto page Previous  1, 2
 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
papadi
Supermod


Joined: 20 Oct 2009
Posts: 594
Topics: 1

PostPosted: Mon Feb 24, 2014 2:16 pm    Post subject: Reply with quote

Cool, time spent learning is a good thing Wink
_________________
All the best,

di
Back to top
View user's profile Send private message
semigeezer
Supermod


Joined: 03 Jan 2003
Posts: 1014
Topics: 13
Location: Atlantis

PostPosted: Tue Feb 25, 2014 1:36 am    Post subject: Reply with quote

If you are feeling adventurous, you can write this type of macro using more detailed compiler output which I think is called SYSADATA or ADATA (??). Using that data instead of a listing gives consistent data that is not dependent on listing options. But it does require either compiling the program from within the macro or having SYSADATA available as part of your compile process (and SYSADATA is really huge). I don't know if SYSADATA would help track down unreachable code, but it might.

A few years ago I was able to write a macro that compiles the program being edited, collects the SYSADATA and then inserts the messages into the editor at the appropriate places using ERR and INFO lines. It is a major pain in the *** to do because the SYSADATA record formats are cryptic and binary and determining the line numbers for errors within nested copybooks is a little convoluted, but it is possible. The SYSADATA record formats are in the COBOL books. Unfortunately I can't share the macro but it was done in Rexx (with a few in-line ISPF panels to set compiler & copybook libraries, options and help).

A word of warning though: This is really an exercise for when you are either hopelessly bored, between assignments, or trying really hard to avoid some other work. I found it very challenging, but fun and it took me a week or two (after hours!) to make it work as I wanted. I'm a big fan of inline error messages (or some other automated way to locate the error location such as the way RDz does it). I'm the poster child for that "lazy developer" you mentioned...except when it comes to writing tools to aid my laziness.
_________________
New members are encouraged to read the How To Ask Questions The Smart Way FAQ at http://www.catb.org/~esr/faqs/smart-questions.html.
Back to top
View user's profile Send private message Visit poster's website
misi01
Advanced


Joined: 02 Dec 2002
Posts: 629
Topics: 176
Location: Stockholm, Sweden

PostPosted: Tue Feb 25, 2014 4:19 am    Post subject: Agree di. I also define myself as being lazy Reply with quote

If I have to do something that is convoluted and prone to error, I tend to write a macro (or a script in Reginald rexx on the pc) that will take the work out of the job next time I have to go down the same path.
_________________
Michael
Back to top
View user's profile Send private message Send e-mail
William Collins
Supermod


Joined: 03 Jun 2012
Posts: 437
Topics: 0

PostPosted: Tue Feb 25, 2014 8:29 am    Post subject: Reply with quote

Me too. I just don't think this example is one of those Smile

Dead code often indicates program-error. OPT spots dead code, whether the whole of a procedure, or just a bit within a procedure. You can't match that unless you mimic the compiler.

OPT(FULL) will identify unused storage, taking REDEFINES into account as well. It is flagged in the data-map.

As far as I can see. the compiler already gives you all that you want (or can, with OPT(FULL)).

If you then want to suck that information into an edit session, fine. I just don't think it happens often enough to make it worthwhile.

If the systems you are working on have old and heavily maintained code, then perhaps the additional step makes sense. Perhaps. But there may be other things that would be useful first..
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF All times are GMT - 5 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group