View previous topic :: View next topic |
Author |
Message |
krk123 Beginner

Joined: 03 Jun 2003 Posts: 58 Topics: 19
|
Posted: Wed Nov 12, 2003 3:22 pm Post subject: REXX tool. |
|
|
Hi,
I am new to REXX. I am looking for a small REXX tool. My requirement is: I want to put a display after each paragraph in my program.
1000-open-files
display '1000-open-files'
1000-exit
display '1000-exit'.
If there are 10 paras in the program I want 10 displays. Please share the code with me if you have something similar. I can make the modifications.
Thanks,
KRK123. |
|
Back to top |
|
 |
Ashish Jain Beginner

Joined: 09 Dec 2002 Posts: 15 Topics: 0 Location: India
|
Posted: Thu Nov 13, 2003 5:46 am Post subject: |
|
|
Few days before I wrote one REXX for the same.....
Code: |
/***************************** REXX **********************************/
"FREE F(TSOURCE SOURCE)"
USR = USERID()
/* GIVE THE SOURCE PDS AND MEMBER NAME TO BE TRACED */
SRCFILE = USR || '.PDSNAME(MEMBER)'
"ALLOCATE DDNAME(SOURCE) DSN('"SRCFILE"') SHR"
"EXECIO * DISKR SOURCE (STEM COUNT. FINIS"
/* GIVE THE SOURCE PDS AND MEMBER NAME TO BE TRACED */
TRCFILE = USR || '.PDSNAME(MEMBER)'
"ALLOC DA('"TRCFILE"') F(TSOURCE) OLD"
IF RC \= 0 THEN
DO
"ALLOC DA('"TRCFILE"') F (DOC) NEW,
RECFM(F,B) LRECL(80) BLKSIZE(8000) SPACE(100,100) DSORG(PS)"
END
COUNTER = 1
WS1 = "*TRACE 01 PX VALUE 'MEMBER' PIC X(08)."
WS2 = "*TRACE 01 FILLER VALUE '1' PIC X(01)."
WS3 = "*TRACE 88 DX VALUE '1'."
WS4 = "*TRACE 88 DX-OFF VALUE '0'."
GENLEFT = "*TRACE IF DX DISPLAY PX ' - "
GENRIGHT = "' END-IF."
FLAG = 0
DO J = 1 TO COUNT.0
LINE = COUNT.J
TEMPSTR = SUBSTR(LINE,8,23)
CHAR7 = SUBSTR(LINE,7,1)
CHAR8 = SUBSTR(LINE,8,1)
CHAR9 = SUBSTR(LINE,9,1)
PROCD = SUBSTR(LINE,8,9)
GENMID = SUBSTR(LINE,8,73)
SKIP = SPACE(GENMID,0)
IF TEMPSTR = 'WORKING-STORAGE SECTION' THEN DO
OUT.COUNTER = LINE
COUNTER = COUNTER + 1
OUT.COUNTER = WS1
COUNTER = COUNTER + 1
OUT.COUNTER = WS2
COUNTER = COUNTER + 1
OUT.COUNTER = WS3
COUNTER = COUNTER + 1
OUT.COUNTER = WS4
COUNTER = COUNTER + 1
END
ELSE
IF CHAR7 /= '*' & CHAR8 /= ' ' & CHAR9 /= ' ' & FLAG = 1 & ,
SKIP /= 'SKIP1' & SKIP /= 'EJECT' THEN DO
GENMID = SPACE(GENMID,0)
PARSE VAR GENMID GENMID '.'
OUT.COUNTER = LINE
COUNTER = COUNTER + 1
OUT.COUNTER = GENLEFT || GENMID || GENRIGHT
COUNTER = COUNTER + 1
END
ELSE DO
OUT.COUNTER = LINE
IF PROCD = 'PROCEDURE' THEN DO
FLAG = 1
END
COUNTER = COUNTER + 1
END
END /* END OF DO LOOP */
"EXECIO * DISKW TSOURCE (STEM OUT. FINIS"
"FREE F(TSOURCE SOURCE)"
|
You have to make some changes to make it usable for you !
Change the PDSNAME and MEMBER name accordingly.
The preview shows the code in proper format, not the actual post ! Don't know why ! You have to manage |
|
Back to top |
|
 |
krk123 Beginner

Joined: 03 Jun 2003 Posts: 58 Topics: 19
|
Posted: Thu Nov 13, 2003 8:36 am Post subject: |
|
|
Thaanks Ashish. I will test this and will let u know how it goes.
Thanks,
Krk123 |
|
Back to top |
|
 |
taltyman JCL Forum Moderator

Joined: 02 Dec 2002 Posts: 310 Topics: 8 Location: Texas
|
Posted: Thu Nov 13, 2003 8:50 am Post subject: |
|
|
I hope you remove those displays before the program goes production. |
|
Back to top |
|
 |
krk123 Beginner

Joined: 03 Jun 2003 Posts: 58 Topics: 19
|
Posted: Thu Nov 13, 2003 9:28 am Post subject: |
|
|
Hi Taltyman,
This is just for my testing. This not not gonna go in to production.
Regards,
Krk123 |
|
Back to top |
|
 |
taltyman JCL Forum Moderator

Joined: 02 Dec 2002 Posts: 310 Topics: 8 Location: Texas
|
Posted: Thu Nov 13, 2003 10:55 am Post subject: |
|
|
Good then krk. I only mentioned it since we had lots of programs that did displays and wrote 1000s of lines of output in production. The programmers left them there 'just in case there is a problem with their code'. We've managed to get most of them re-compiled with the displays removed but a few remain. |
|
Back to top |
|
 |
vijay Beginner
Joined: 09 May 2003 Posts: 131 Topics: 64
|
Posted: Wed Nov 19, 2003 3:38 pm Post subject: |
|
|
try this code .. .It's working for me ..
[code:1:bd4e8156a1]
ISREDIT MACRO
ISREDIT SEEK PROC 8 FIRST
IF &LASTCC = 0 THEN +
GOTO CONTNU:
ELSE
ISREDIT RESET /* RES
EXIT CODE(0)
END
CONTNU: DO
SET &LASTCC = 0
SET &MAXCC = 0
SET &MASKD = &STR(DISPLAY 'DEBUG~ )
SET &PARAOSET = 7
SET &DISPOSET = 12
END
ISREDIT SEEK P' |
|
Back to top |
|
 |
|
|