View previous topic :: View next topic
|
Author |
Message |
Jaffer Sadiq
New User
Joined: 05 Mar 2013 Posts: 2 Location: India
|
|
|
|
Hi, I am a beginner learning REXX. I am developing a tool for counting LOC of a member for a given PDS. So far I am good with the total count which I getting, but now I need to expand the copybook and then count the LOC. For doing this I used ISPEXEC VIEW command after the allocation of the PDS member is done, but its not executing in the background. For that I need to press enter manually then ony I will be able to get out of the loop... Can anyone help me with this... |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Not without seeing the code, but usually an "ISREDIT END" statement missing from the macro |
|
Back to top |
|
|
Stefan
Active User
Joined: 12 Jan 2006 Posts: 110 Location: Germany
|
|
|
|
What also often causes the need for an additional ENTER is that you queued data to the stack without terminating with a null string as last stack entry, and then used EXECIO DISKR with an asterix (*). In this case the EXECIO function reads all queued lines, does not find any EOF indicator, and thus waits for additional lines from the default input queue SYSTSIN (terminal).
This could easily avoided by either queueing a null string as the last line to the stack, or replace the asterix used for the EXECIO function by a variable containing the number of lines queued. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Just reading back over this
Background .......... suggests a BATCH operation, yet you say that you need to press ENTER
is this a background (BATCH) operations or a foreground (TERMINAL) operation.
You really do need to be accurate when describing a problem |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
why reinvent the wheel when there are ready to run tools that just do it
see for example
Quote: |
Report
High Level Assembler for z/OS & z/VM & z/VSE V1R6 (HLASM V1R6) Toolkit Feature User's Guide
GC26-8710-09
You can abbreviate REPORT to R.
Specifies the format of the reports you require. ASMXREF requires at least one REPORT statement in the control file. Specify the following parameter with this control statement:
REPORT
The name of the required report. Valid reports are:
CF
Control Flow Report
LOC
Lines of Control Report <== that really lines of code
LOOC
Lines of OO Code Report
MWU
Macro Where Used Report
SOR
Spreadsheet Oriented Report
SWU
Symbol Where Used Report
TWU
Token Where Used Report
You can specify only one report on each REPORT statement. For details on the reports available see Understanding the reports. To specify more than one report create a REPORT control statement for each desired report. |
which when run will give
Code: |
********************************* TOP OF DATA **********************************
Date: 03/06/2013 ASMXREF V1.6.0 Lines of Code Report Page 1
Time: 11:29:49 by Module
Product = NO INPUT
Release = ALL
Programmer = ALL
(ADD+CHG)
Module Language Records Comments SSI CSI ADDED CHA
1 COBJRX COBOL 66 19 25
2 COBXRX COBOL 216 25 126
3 DATES COBOL 47 0 31
4 HELLO COBOL 9 0 6
5 NUMBERS COBOL 34 0 30
6 PARMS COBOL 15 0 11
7 PICS COBOL 23 0 19
8 RETCODE COBOL 9 0 6
9 RETCOD2 COBOL 17 0 12
10 UNSTRING COBOL 25 0 18
PRODUCT TOTALS: 461 44 284
REPORT TOTALS: 461 44 284
Date: 03/06/2013 ASMXREF V1.6.0 Lines of Code Report Page 2
Time: 11:29:49 Programmer Summary Report |
|
|
Back to top |
|
|
Jaffer Sadiq
New User
Joined: 05 Mar 2013 Posts: 2 Location: India
|
|
|
|
ADDRESS TSO "ALLOC DA('"DSN0"') DD(OUTDD) MOD REUSE"
"EXECIO 0 DISKW OUTDD (OPEN"
X = OUTTRAP('VAR.')
"LISTDS '"DSN_NAME"' MEMBERS"
G = 0
DO NUM = 7 TO VAR.0
MEM=DSN_NAME || '(' || STRIP(VAR.NUM) || ')'
DSE=SYSDSN("'"MEM"'")
IF (DSE = 'OK') THEN
"FREE DD(INDD)"
ADDRESS TSO "ALLOC DA('"MEM"') DD(INDD) SHR REUSE"
ADDRESS ISPEXEC "VIEW DATASET('"MEM"') MACRO(XPNDJF)"
IN_LCTR = 0
LINEDATA = ''
"EXECIO 0 DISKR INDD (OPEN"
"EXECIO * DISKR INDD (FINIS STEM COUNT."
IF RC = 0 THEN
DO I = 1 TO COUNT.0
POSITION = POS('*',COUNT.I)
LINEDATA = SUBSTR(COUNT.I,7,72)
IF (POSITION \= 7) THEN
DO
IF (LINEDATA \= SP) THEN
DO
IN_LCTR = IN_LCTR + 1
END
END
END
SAY IN_LCTR
G = G + 1
REPORT.G = MEM || ''LINES OF CODE'' IN_LCTR
"EXECIO 0 DISKR INDD (FINIS"
"FREE FI(INDD)"
END
X = OUTTRAP('OFF')
I used the bold line mentioned for expanding a copybook which has a macro "XPNDJF". My problem is without expanding I am able to get the total count of LOC for a given member in PDS. But I need to do that after expanding the copybook. For doing this, I used the ISPEXEC VIEW but not working so far. Is there any ways to implement or a way to invoke this macro and execute it further... |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
I do hope that some day I will understand this preoccupation with knowing how many lines of code there are.
Does it really matter how many there are if the program works, and work efficiently ??? |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
and I still do not know why use some in-house tool when there are sound alternatives
|
|
Back to top |
|
|
prino
Senior Member
Joined: 07 Feb 2009 Posts: 1306 Location: Vilnius, Lithuania
|
|
|
|
expat wrote: |
I do hope that some day I will understand this preoccupation with knowing how many lines of code there are. |
Indian outsourcers just need their bodies to do something billable... |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
Quote: |
I used the bold line mentioned for expanding a copybook which has a macro "XPNDJF". My problem is without expanding I am able to get the total count of LOC for a given member in PDS. But I need to do that after expanding the copybook. For doing this, I used the ISPEXEC VIEW but not working so far. Is there any ways to implement or a way to invoke this macro and execute it further... |
and most probably they will bill the poor fools by LOC
count umpteen times all the <included> copybooks
that' s a productivity boost
it reminds me of the joke about the <lawyer> at the pearly gates
with everybody congratulating him for his nice looks for a 132 years old guy
but I am only 62 ...
nope we summed up all the billed hours and according to that You are 132 |
|
Back to top |
|
|
|