View previous topic :: View next topic
|
Author |
Message |
sonu_winks
New User
Joined: 23 Nov 2005 Posts: 23
|
|
|
|
Hi,
Can somebody help me with a JCL utility and syntax to count the no of lines of codes from a PDS. I need to omit the commented lines in the programs which are residing as members in this PDS.
cheers,
me. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Take a look through the DFSORT / UTILITIES or the JCL section.
This, or similar has been discussed before. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
can't help but asking. What is this report for? |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
each programming language has its own syntax for a comment.
each programming language has white space allowances. For instance COBOL you would count this as 2
Code: |
*
COMPUTE AVG = (HI * WA) + (CA - WG) * XIA/XIM END-COMPUTE
DISPLAY AVG
|
Whereas you would count this as 25
Code: |
MULT HI
BY WA
GIVING HIWA
SUBTRACT WG
FROM CA
GIVING CA-WG
DIVIDE XIA
BY XIM
GIVING XIA-BY-XIM
MULT
CA-WG
BY
XIA-BY-XIM
GIVING
SUB-TOT-ONE
ADD
SUB-TOT-ONE
HIWA
GIVING
SUB-TOT-TWO
MOVE
SUB-TOT-TWO
TO
AVG
DISPLAY AVG
|
each accomplishing the same thing. I was just wondering; these meaningful statistics are going to be used how????? |
|
Back to top |
|
|
Devzee
Active Member
Joined: 20 Jan 2007 Posts: 684 Location: Hollywood
|
|
|
|
sonu_winks
How about copy statement in COBOL program?
Is this according to you counted as 1 line? |
|
Back to top |
|
|
stodolas
Active Member
Joined: 13 Jun 2007 Posts: 631 Location: Wisconsin
|
|
|
|
Everyone knows that all good mainframe organizations brag about the number of lines of code they create and maintain every year. I never understood the rational behind it as dbz gave a perfect example of why it is horrible.
Here is my example in in C++ or Java:
Code: |
if (someBool = True) {
int i = 1
;
}
|
Code: |
if (someBool = True) { int i = 1 ;}
|
Code: |
if (someBool = True)
{
int i = 1
;
}
|
|
|
Back to top |
|
|
sonu_winks
New User
Joined: 23 Nov 2005 Posts: 23
|
|
|
|
Expat,
I dont find anything to count the no of lines in the PDS members in DFSORT.Could you please provide the link ?
I am looking to count the total lines of codes in the members using a single job ,excluding the comment lines ..
thnx. |
|
Back to top |
|
|
sonu_winks
New User
Joined: 23 Nov 2005 Posts: 23
|
|
|
|
Devzee,
Copy statements will be counted as single line.
Thnx |
|
Back to top |
|
|
stodolas
Active Member
Joined: 13 Jun 2007 Posts: 631 Location: Wisconsin
|
|
|
|
sonu_winks, how would you account for dbz's example then? The number of lines is pretty meaningless there. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
As was asked previously - what will this "report" be used for?
DFSORT can count the number of lines of an input file - it does not matter if the input is a file, a member of a pds, or a concatenation of files and/or members. |
|
Back to top |
|
|
stodolas
Active Member
Joined: 13 Jun 2007 Posts: 631 Location: Wisconsin
|
|
|
|
Dick,
My organization proudly says "We have #### lines of Cobol code in production." I don't know what purpose it serves either. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hi Steve,
Yup, see it quite often. . .
When i first arrive at a new site, they usually have some kind of meeting to do intros and chat about the adventure we are part of. Often someone will "just have to" announce that "we have #### lines of code" or "we expect this project will require #### lines of code".
If often gets quiet when i ask "What is a line of code here"? Even though there are numbers tossed about, not everyone in the organization agrees on just what constitutes a line of code.
Oh, well. Kinda reminds me of when i was young and my dad would ask "How many balls of string would it take to reach the moon?". Some of the youngsters would start thinking and figuring. . . The answer, of course was one - if it was long enough.
Begin
Compute
End
Fine "code" . . . . elegantly understated
d |
|
Back to top |
|
|
|