Page 1 of 1

Rexx code for commenting Pl/1 programs

PostPosted: Thu Aug 20, 2015 11:56 am
by som07
Hi All,

We have a requirement to create REXX MACRO to comment out given block of PL/1 code. We have tried a lot of permutations and combinations, but none of them gave us the expected results.

If anyone has any leads kindly let us know !
:roll: :roll: :| :|

Re: Rexx code for commenting Pl/1 programs

PostPosted: Thu Aug 20, 2015 12:37 pm
by NicC
you need to show us what you have and what you have tried and what went wrong and you need to explain how this is meant to work - automagially or by placing the cursor and executing the macro type of thing.

[Edit] remember to post code and data within code tags.

Re: Rexx code for commenting Pl/1 programs

PostPosted: Thu Aug 20, 2015 12:50 pm
by prino
Use user defined edit macro line commands, mark the block to be commented and enter your edit macro. Seamless on z/OS 1.13, with its builtin support for line macros - and remember that PL/I does not allow nested comments, so change comments in the to-be-commented block into /^ & ^/ (or whatever).

Re: Rexx code for commenting Pl/1 programs

PostPosted: Thu Aug 20, 2015 9:21 pm
by Pedro
Please provide sample data. Show us the data before your macro is executed and also show us the desired results.

Re: Rexx code for commenting Pl/1 programs

PostPosted: Thu Aug 20, 2015 10:31 pm
by prino
I guess that from

       /*--------------------------------------------------------------+
       | Initialised pointers                                          |
       |                                                               |
       |  - total_ptr        Address of trip_total record              |
       |  - line_ptr         Print line                                |
       |  - static_ptr       Address of static storage                 |
       +--------------------------------------------------------------*/
       2 filler          char      (16) init ('INIT POINTERS'),
       2 total_ptr       ptr            init (addr(trip_total)),
       2 line_ptr        ptr            init (addr(line)),
       2 static_ptr      ptr            init (addr(work_static)),

you need to go to

 /*- Code commented out by USERID @ 2015-08-20T19:53 -------------------
       /^--------------------------------------------------------------+
       | Initialised pointers                                          |
       |                                                               |
       |  - total_ptr        Address of trip_total record              |
       |  - line_ptr         Print line                                |
       |  - static_ptr       Address of static storage                 |
       +--------------------------------------------------------------^/
       2 filler          char      (16) init ('INIT POINTERS'),
       2 total_ptr       ptr            init (addr(trip_total)),
       2 line_ptr        ptr            init (addr(line)),
       2 static_ptr      ptr            init (addr(work_static)),
 --- End of commented out code by USERID @ 2015-08-20T19:53 ----------*/

Where the userid & date are inserted by the macro. And of course nothing should stop the TS to add more to the comment lines, in a macro that I use to trace the calls of a PL/I program, every line of inserted code contains a

/*{T}*/

comment, allowing me to remove all of it by a

res;x '/*{T}*/' all;del x all

command.