View previous topic :: View next topic |
Author |
Message |
vijay Beginner
Joined: 09 May 2003 Posts: 131 Topics: 64
|
Posted: Fri Sep 12, 2003 1:58 pm Post subject: Help with an edit macro |
|
|
Hi,
Can u guys give me any rexx routine or edit macro that displays the para or section name after each and every para or section in a cobol pgm. .
I just need a display 'para or section name' as the first line in
each para or section.Any help would be great.
Thanks,
Vijay |
|
Back to top |
|
|
taltyman JCL Forum Moderator
Joined: 02 Dec 2002 Posts: 310 Topics: 8 Location: Texas
|
Posted: Fri Sep 12, 2003 3:58 pm Post subject: |
|
|
try this in your edit command line....
X ALL;F ALL para
Not really sure of what you want to display though.
Basically the X ALL excludes all lines then the F ALL xxxx displays all lines containing xxxx |
|
Back to top |
|
|
slade Intermediate
Joined: 07 Feb 2003 Posts: 266 Topics: 1 Location: Edison, NJ USA
|
Posted: Sat Sep 13, 2003 9:48 am Post subject: |
|
|
Hi Taltyman,
I think Vijay wants to DISPLAY the pgraph names as the pgm executes.
Vijay,
I have a version written in CLIST/ISPF Macros. If you want a copy let me know.
Regards, Jack. |
|
Back to top |
|
|
vijay Beginner
Joined: 09 May 2003 Posts: 131 Topics: 64
|
Posted: Sat Sep 13, 2003 11:47 am Post subject: |
|
|
Slade ,
U're right.CLIST is fine too.Can u post that please ...
Thanks,
Vijay |
|
Back to top |
|
|
slade Intermediate
Joined: 07 Feb 2003 Posts: 266 Topics: 1 Location: Edison, NJ USA
|
Posted: Sat Sep 13, 2003 7:31 pm Post subject: |
|
|
Here's something I wrote when the rumors that TRACE was going bye-bye were rampant. I understand it is still scheduled to be withdrawn, but I'm not sure when.
DISPARA is an ISPF macro that simulates the READY TRACE
function by inserting DISPLAY statements behind
all Procedure Division paragraph and section headings
(including exit paragraphs) in a COBOLII and above program.
One advantage over TRACE is that DISPARA presents each pgraph
name on its own line, making it easier to read and/or to find
pgraph names in the SYSOUT. TRACE, on the other hand, strings
the pgraph names on the line until it is full.
Each DISPLAY presents the heading to sysout in the form:
"DEBUG~ PARAGRAPH-SECTION-NAME."
along with your other DISPLAYed data.
To rid the code of these displays when no longer needed, enter the following on the command line of your ISPF edit session after loading the program code:
x all;f all debug~;del all nx
For the more cautious among us these commands can, of course, be issued individually and after review of the results from the previous command.
As an alternative, you can temporarily suspend the DISPLAYs with the following:
x all;f all debug~;c all nx 7 ' ' '*'
and reactivate them with:
x all;f all debug~;c all nx 7 ' ' '*'
The Macro code follows. Some shops have their TSO logon procs set up to concatenate a user clist file to the SYSPROC DD statement. The dsname form is usually ?yourtsoid.CLIST?. Some shops have a ?community? CLIST dataset for use by application types. Put the macro code into the dataset as member name DISPARA or whatever. If TSO doesn't recognize the CLIST dataset, contact your friendly sysprog for help.
P.S. The formatting when displayed here is a little funky. Especially the comments. If you want a .txt attachment, contact me via private msg (click on my handle) and leave your e-mail addr.
Code: |
ISREDIT MACRO
ISREDIT RESET /* RESET ALL EDIT CMD*/
ISREDIT EXCLUDE ALL /* X OUT ALL LINES */
SET &ENVTYP = 'PDS'
ISREDIT SEEK 7 ' PROCEDURE ' FIRST /* F PROCDURE DIVSN */
IF &LASTCC = 0 THEN +
GOTO CONTNU:
ISREDIT SEEK 1 ' PROCEDURE ' FIRST
IF &LASTCC > 0 THEN +
DO
WRITE NEITHER PDS OR LIBR DATASET
ISREDIT RESET /* RESET ALL EDIT CMD*/
EXIT CODE(0)
END
ELSE +
SET &ENVTYP = 'LIBR'
CONTNU: DO
IF &ENVTYP = 'PDS' THEN +
DO
SET &PARAOSET = 7
SET &DISPOSET = 12
END
ELSE +
DO
SET &PARAOSET = 1
SET &DISPOSET = 6
END
SET &MASKD = &STR(DISPLAY 'DEBUG~ )
ISREDIT (CURLIN) = LINENUM .ZCSR /* ID 1ST LINE */
SET &CURLIN = &CURLIN + 1 /* OF */
ISREDIT LABEL (CURLIN) = .A /* CODE */
ISREDIT FIND ALL P' ^' &PARAOSET .A .ZL /* FIND ALL PARA NMS */
ISREDIT (CURLIN) = LINENUM .ZCSR /* SAVE LN# OF 1ST */
SET &LASTCC = 0 /* PARA AND SET CC */
SET &MAXCC = 0
END
/* */
/* THIS DO RTN FINDS EACH PGRAPH HEAD, COPIES IT AND USES */
/* IT AS A LITERAL FOR THE DISPLAY STMT CREATED FROM THE */
/* COPIED LINE. WHEN THERE ARE NO MORE PARAS, THE FIND X */
/* FAILS, THE MAXCC IS SET TO NON ZERO AND THE LOOP IS */
/* BROKEN. */
/* */
DO WHILE (&MAXCC = 0) /* */
ISREDIT (PARLIN) = LINE (CURLIN) /* DUPLICATE THE PAR-*/
ISREDIT LINE_AFTER (CURLIN) = (PARLIN) /* AGRAPH HEADING. */
SET &CURLIN = &CURLIN + 1 /* MAKE ROOM FOR */
ISREDIT SHIFT ) &CURLIN 20 /* MASK DATA. */
/* MAKE A DISPLAY STMT OF THE REPEATED LINE */
ISREDIT LINE (CURLIN) = LINE + <&DISPOSET (MASKD) 60 "'.">
ISREDIT EXCLUDE P'=' 1 FIRST /* SET UP FOR NEXT */
ISREDIT EXCLUDE P'=' 1 NEXT /* PARAGRAPH HEAD. */
ISREDIT FIND P'=' 1 NX /* */
ISREDIT (CURLIN) = LINENUM .ZCSR /* */
END /* */
ISREDIT RESET /* RESET ALL EDIT CMD*/
ISREDIT SEEK &PARAOSET ' PROC' FIRST /* F PROCEDURE DIVSN */
ISREDIT MEND /* */
EXIT CODE (&LASTCC) /* */
|
|
|
Back to top |
|
|
|
|