Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Count lines of codes from a PDS

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> FAQ & Off Topics
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    Post subject: Count lines of codes from a PDS
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: 8593
Location: Back in jolly old England

PostPosted: Wed Aug 22, 2007 9:27 pm    Post subject:
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: 6968
Location: porcelain throne

PostPosted: Wed Aug 22, 2007 9:36 pm    Post subject:
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: 6968
Location: porcelain throne

PostPosted: Wed Aug 22, 2007 9:48 pm    Post subject:
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    Post subject:
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: 632
Location: Wisconsin

PostPosted: Wed Aug 22, 2007 11:27 pm    Post subject:
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    Post subject:
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    Post subject:
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: 632
Location: Wisconsin

PostPosted: Thu Aug 23, 2007 6:51 pm    Post subject:
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

Site Director


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

PostPosted: Thu Aug 23, 2007 7:13 pm    Post subject:
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: 632
Location: Wisconsin

PostPosted: Thu Aug 23, 2007 7:15 pm    Post subject:
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

Site Director


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

PostPosted: Thu Aug 23, 2007 7:29 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> FAQ & Off Topics All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
No new posts column with count of rows within dist... ronald wouterson DB2 4 Sun Sep 17, 2017 9:48 pm
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm
No new posts SORT Trailer Count - LRECL Output co... amorante DFSORT/ICETOOL 5 Tue Aug 29, 2017 8:57 pm
No new posts CICS Transaction attach count of supp... lind sh CICS 1 Wed Jun 21, 2017 1:33 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us