Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Counting Lines of Code in all the members of the PDS

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Counting Lines of Code in all the members of the PDS
 Login/Join
 
Silver Member
posted
Hi,

I need to count the lines of code of all the Cobol programs present in a PDS. I have tried REXX and SELCOPY, the results are okay, but the execution time is very high. I wanted to do this through Focus procedures. Is it possible to get a report in the following way using Focus procedure in batch/online:

PDS: userid.cobol.programs

Member LineCount
Program1 2394
Program2 994
Program3 9342
Program4 1263

where Program1...etc are the members of the PDS userid.cobol.programs

Many thanks for your help.


FOCUS 7.2.3
Platform: IBM system Z9 Business class
O/P formats: Flat files, excel and CSV files
 
Posts: 39 | Location: Hyderabad, India | Registered: April 28, 2007Report This Post
Expert
posted Hide Post
Shrikant,

I do this sort of thing in a Unix environment all the time. The first thing you need is a generic master that I call LINE80.
FILE=LINE80       ,SUFFIX=FIX
SEGNAME=LINE80,SEGTYPE=S01
FIELDNAME=LINE80, ALIAS=LN80 ,FORMAT=A80, ACTUAL=A80,$

Then you need some sort of operating system command (maybe LISTMEM) that lists the members of the PDS and you have to pipe the output to a file. You might be able to use APP commands.
quote:
APP QUERY app HOLD Writes a list of all files in the directory app to a file focappl.ftm in EDATEMP; the output is described by focappq.mas.

You would have to set the APP PATH first to point to only that directory.

Next (assuming we are using APP QUERY), TABLE focappq and write the focexec names to a SAVE file.

Then filedef an output file, let's call it FEXCOUNT, and make sure that you have (APPEND at the end of the filedef. You are going to be building this file as you go.

Then set up a loop using -REPEAT and -READ to loop through the SAVE file. For each entry, filedef the master LINE80 to this member of the PDS. Then,
DEFINE FILE LINE80
FEXNAME/A8='&FEXNAME';
END
TABLE FILE LINE80
COUNT LINE80 AS LINECNT
BY FEXNAME
ON TABLE HOLD AS FEXCOUNT FORMAT ALPHA
END  

Then loop and get the next one.

When you are done, the file FEXCOUNT contains a list of all the focexecs and the number of lines in each.

I don't know if this will be any faster but it is certainly doable. This is just a mix of Dialogue Manager, APP commands, filedefs, and TABLE.

I could write the code for you but that would take all the fun out of it for you. Give it a try.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Report This Post
Expert
posted Hide Post
I'm sure I did this 15-20 yeasrs ago, with a master that could read PDS's, you could get the name and length of each member.

Just did a quick search of Techsupport, seems it was called FOCMAP.

Another possibility, what do you get if you use APP MAP, APP QUERY ?

This message has been edited. Last edited by: Waz,


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Counting Lines of Code in all the members of the PDS

Copyright © 1996-2020 Information Builders