Rexx code for commenting Pl/1 programs



IBM's Command List programming language & Restructured Extended Executor

Rexx code for commenting Pl/1 programs

Postby som07 » Thu Aug 20, 2015 11:56 am

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: :| :|
som07
 
Posts: 3
Joined: Thu Jul 16, 2015 12:11 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Rexx code for commenting Pl/1 programs

 

Re: Rexx code for commenting Pl/1 programs

Postby NicC » Thu Aug 20, 2015 12:37 pm

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.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2755
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 110 times

Re: Rexx code for commenting Pl/1 programs

Postby prino » Thu Aug 20, 2015 12:50 pm

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).
Robert AH Prins
robert.ah.prins @ the.17+Gb.Google thingy
User avatar
prino
 
Posts: 555
Joined: Wed Mar 11, 2009 12:22 am
Location: Oostende, Belgium
Has thanked: 3 times
Been thanked: 24 times

Re: Rexx code for commenting Pl/1 programs

Postby Pedro » Thu Aug 20, 2015 9:21 pm

Please provide sample data. Show us the data before your macro is executed and also show us the desired results.
Pedro Vera
User avatar
Pedro
 
Posts: 579
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 41 times

Re: Rexx code for commenting Pl/1 programs

Postby prino » Thu Aug 20, 2015 10:31 pm

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.
Robert AH Prins
robert.ah.prins @ the.17+Gb.Google thingy
User avatar
prino
 
Posts: 555
Joined: Wed Mar 11, 2009 12:22 am
Location: Oostende, Belgium
Has thanked: 3 times
Been thanked: 24 times


Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post