IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Count lines of codes from a PDS


IBM Mainframe Forums -> FAQ & Basics
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sonu_winks

New User


Joined: 23 Nov 2005
Posts: 23

PostPosted: Wed Aug 22, 2007 9:23 pm
Reply with quote

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. icon_biggrin.gif
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8796
Location: Welsh Wales

PostPosted: Wed Aug 22, 2007 9:27 pm
Reply with quote

Take a look through the DFSORT / UTILITIES or the JCL section.

This, or similar has been discussed before.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Aug 22, 2007 9:36 pm
Reply with quote

can't help but asking. What is this report for? icon_lol.gif
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Aug 22, 2007 9:48 pm
Reply with quote

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
View user's profile Send private message
Devzee

Active Member


Joined: 20 Jan 2007
Posts: 684
Location: Hollywood

PostPosted: Wed Aug 22, 2007 10:12 pm
Reply with quote

sonu_winks
How about copy statement in COBOL program?
Is this according to you counted as 1 line?
Back to top
View user's profile Send private message
stodolas

Active Member


Joined: 13 Jun 2007
Posts: 631
Location: Wisconsin

PostPosted: Wed Aug 22, 2007 11:27 pm
Reply with quote

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
View user's profile Send private message
sonu_winks

New User


Joined: 23 Nov 2005
Posts: 23

PostPosted: Thu Aug 23, 2007 3:28 pm
Reply with quote

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
View user's profile Send private message
sonu_winks

New User


Joined: 23 Nov 2005
Posts: 23

PostPosted: Thu Aug 23, 2007 3:32 pm
Reply with quote

Devzee,

Copy statements will be counted as single line.

Thnx
Back to top
View user's profile Send private message
stodolas

Active Member


Joined: 13 Jun 2007
Posts: 631
Location: Wisconsin

PostPosted: Thu Aug 23, 2007 6:51 pm
Reply with quote

sonu_winks, how would you account for dbz's example then? The number of lines is pretty meaningless there.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Thu Aug 23, 2007 7:13 pm
Reply with quote

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
View user's profile Send private message
stodolas

Active Member


Joined: 13 Jun 2007
Posts: 631
Location: Wisconsin

PostPosted: Thu Aug 23, 2007 7:15 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Thu Aug 23, 2007 7:29 pm
Reply with quote

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 icon_smile.gif

d
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> FAQ & Basics

 


Similar Topics
Topic Forum Replies
No new posts Mark Previous & next lines when a... DFSORT/ICETOOL 9
No new posts CA7 count with DATE variable CA Products 0
No new posts To get the count of rows for every 1 ... DB2 3
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts Return codes-Normal & Abnormal te... JCL & VSAM 7
Search our Forums:

Back to Top