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

No.of lines of code in a PDS library


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
satish kanamarlapudi

New User


Joined: 23 Jul 2008
Posts: 29
Location: Little Rock - Arkansas

PostPosted: Wed Oct 15, 2008 4:27 pm
Reply with quote

Hi,

Can anybody help me in how to find the number of lines of code in a PDS library?

Thx,
Satish
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Wed Oct 15, 2008 4:52 pm
Reply with quote

Any reason to need to know this. Not once in 30+ years have I ever needed to know something like this
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Wed Oct 15, 2008 4:52 pm
Reply with quote

Take a look at CBTTAPE, file 382 (program UNLOAD). It produces a list of members together with the record count for each member. I wrapped it with REXX to sum the records of the whole PDS.

O.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Wed Oct 15, 2008 5:07 pm
Reply with quote

ISPF option 3.4, bring up the PDS on a selection list, enter PX beside the PDS. This prints the member names and line counts along with total lines.
Back to top
View user's profile Send private message
satish kanamarlapudi

New User


Joined: 23 Jul 2008
Posts: 29
Location: Little Rock - Arkansas

PostPosted: Wed Oct 15, 2008 5:08 pm
Reply with quote

We moved the production libraries to Endevor libraries for programs,jcls,procs,copybooks, dcl gen's etc .... So for this the client wants the total count lines of code moved to Endevor for each library and they want this for a cost n space estimation....

Please let me know if any.

Thx,
satish
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Thu Oct 16, 2008 12:19 am
Reply with quote

satish kanamarlapudi wrote:
Please let me know if any.
Did you happen to notice what Robert has suggested... just before your post.
Back to top
View user's profile Send private message
satish kanamarlapudi

New User


Joined: 23 Jul 2008
Posts: 29
Location: Little Rock - Arkansas

PostPosted: Thu Oct 16, 2008 12:32 am
Reply with quote

Hi Robert,

My libraries are moved fresh to Endevor and they dont have the count in the libraries.

BROWSE NDVR.PROD.DWHS.CBL List saved
Command ===> Scroll ===> PAGE
Name Prompt Size Created Changed ID
_________ DIV200
_________ DIV201
_________ DIV203
_________ DWSARCS1
_________ DWSDRG01
_________ DWSDRG04
_________ DWS005
_________ DWS009
_________ DWS012
_________ DWS014
_________ DWS017
_________ DWS017A
_________ DWS018
_________ DWS019
_________ DWS025
_________ DWS026
_________ DWS027
_________ DWS030
_________ DWS031
_________ DWS033
_________ DWS034
_________ DWS035
_________ DWS036
_________ DWS037
_________ DWS038
_________ DWS039
_________ DWS039A
_________ DWS040
_________ DWS046
_________ DWS047
_________ DWS048
_________ DWS049
_________ DWS051
_________ DWS053
_________ DWS054

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

So i had written a REXX tool to take care of this :-

I opened the libray i want to get the Lines of code and then issued the command 'SAVE SOMENAME' then the member names is stored in the PDS 'USERID.SOMENAME.MEMBERS' . So from here i went on reading the member name only and eliminated the description part in the record and read it from the library member till last line and went on till the last record in 'USERID.SOMENAME.MEMBERS' and each and every time while reading the next record i added the lines of code to the total count.

/*REXX*/
TRACE R
ADDRESS TSO
INPDS1 = 'SXK0000.SOMENAME.MEMBERS'
INPDS2 = 'ATID.DSXK.SCL'
"ALLOC DA('"INPDS1"') F(INDD4) SHR REUSE"
"EXECIO * DISKR INDD4 (STEM IFILE."
OUTPDS = 'ATID.REXX.EXEC(RPT805TZ)'
"ALLOC DA('"OUTPDS"') F(OUTDD4) SHR REUSE"
L2 = 0
DO I = 1 TO IFILE.0
A=WORD(IFILE.I,1)
SAY A
PDS=INPDS2'('A')'
SAY PDS
"ALLOC DA('"PDS"') F(INDD1) SHR REUSE"
"EXECIO * DISKR INDD1 (STEM JFILE. FINIS"
L1 = 0
DO J = 1 TO JFILE.0
L1 = JFILE.0
END
"FREE FI(INDD1)"
L2 = L2 + L1
END
SAY L2
OUT.1 = L2
SAY OUT.1
"EXECIO * DISKW OUTDD4 (STEM OUT. FINIS"
EXIT

Please let me know if any.

Thx,
satish
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Thu Oct 16, 2008 1:07 am
Reply with quote

endevor has all kinds of reports; I have seen several user 'generatable' reports that include the line count of an element.

Forcing ISPF statistics to be generated and accumulated probably cost more than the actual move to endevor.
Back to top
View user's profile Send private message
satish kanamarlapudi

New User


Joined: 23 Jul 2008
Posts: 29
Location: Little Rock - Arkansas

PostPosted: Thu Oct 16, 2008 1:14 am
Reply with quote

I dont know how to generate those reports, and here we need total count of the whole library(not the single member count).

Thx,
satish
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Thu Oct 16, 2008 1:21 am
Reply with quote

Can't you just print the contents of the PDS to a formatted sequential dataset (using either PRINTDS or IEBPTPCH) and then count the number of records in that dataset?
Back to top
View user's profile Send private message
satish kanamarlapudi

New User


Joined: 23 Jul 2008
Posts: 29
Location: Little Rock - Arkansas

PostPosted: Thu Oct 16, 2008 1:24 am
Reply with quote

For printing the contents, see below the size is spaces as they r moved freshly, otherwise tht would be my 1st option....

BROWSE NDVR.PROD.DWHS.CBL List saved
Command ===> Scroll ===> PAGE
Name Prompt Size Created Changed ID
_________ DIV200
_________ DIV201
_________ DIV203
_________ DWSARCS1
_________ DWSDRG01
_________ DWSDRG04
_________ DWS005
_________ DWS009
_________ DWS012
_________ DWS014
_________ DWS017
_________ DWS017A
_________ DWS018
_________ DWS019
_________ DWS025
_________ DWS026
_________ DWS027
_________ DWS030
_________ DWS031
_________ DWS033
_________ DWS034
_________ DWS035
_________ DWS036
_________ DWS037
_________ DWS038
_________ DWS039
_________ DWS039A
_________ DWS040
_________ DWS046
_________ DWS047
_________ DWS048
_________ DWS049
_________ DWS051
_________ DWS053
_________ DWS054
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Oct 16, 2008 2:31 am
Reply with quote

I would say that still the fastest way would be to build the ISPF statistics,
ISPF reading will be certainly be faster than rexx reading


Code:
"EXECIO * DISKR INDD1 (STEM JFILE. FINIS"
L1 = 0
DO J = 1 TO JFILE.0
L1 = JFILE.0
END


why loop for the number of lines ...
ah...to be sure that L1 gets primed properly icon_biggrin.gif

Code:
"EXECIO * DISKR INDD1 (STEM JFILE. FINIS"
L1 = JFILE.0


is more than enough, if You have faith in a single move
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 -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts run rexx code with jcl CLIST & REXX 15
No new posts Compile rexx code with jcl CLIST & REXX 6
No new posts Calling an Open C library function in... CICS 1
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
No new posts Submit multiple jobs from a library t... JCL & VSAM 14
Search our Forums:

Back to Top