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

Identifying Easytrieve and CObol program


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

Active User


Joined: 14 Jul 2005
Posts: 105

PostPosted: Tue Mar 03, 2009 3:26 am
Reply with quote

Dear Experts,

Is there any way to find out the following
I have a program source library which is having only cobol and easytrieve programs in it.
Now i just quickly want to get a count and list of how many of them are cobol and how many are Easytrieve?
I have the some algorithm with me which is as follows
a)Searching on column 8 inside the source library(PDS) if in the next 8 position identification is written its almost safe to conclude that its a cobol program.In this way I can get the Cobol program name .
b)Then we can compare this file with the total number of programs in file to get the Easytrieve programs.

now how to do it in REXX I do not have much clue:-(
Thanks
Back to top
View user's profile Send private message
jobin thomas

New User


Joined: 19 Aug 2008
Posts: 15
Location: Bangalore

PostPosted: Thu Mar 12, 2009 11:42 am
Reply with quote

Your algorithms sounds fine!

Rexx implementation:-

Code:
/* rexx */                                                         
                                                                   
cobol_pgm_count = 0                                               
easytrieve_count = 0                                               
total_pgm_count = 0                                               
pds = 'CJ1P.AIS.SOURCE'   /* your pds here */                     
                                                                   
/* 1. Get the list of members in a pds */                         
x = outtrap(mbrs.)                                                 
"listds '"pds"' members"                                           
total_pgm_count = mbrs.0 - 6                                       
                                                                   
/* 2. read each member and check whether it's a COBOL pgm or not */
do i = 7 to mbrs.0                                                 
    call get_count                                                 
end                                                               
                                                                   
/* 3. Display results */                                           
easytrieve_count = total_pgm_count - cobol_pgm_count               
Say "Total Members  : " total_pgm_count                           
Say "COBOL Source   : " cobol_pgm_count                           
Say "EasyTrieve PGM : " easytrieve_count                           
                                                                   
exit                                                               
                                                                   
/* Subroutine to read the member and check if cobol */             
                                                                   
/*  Assumption: Reading just the first line of COBOL program       
    to check whether it got "IDENTIFICATION DIVISION" */           
get_count:                                                         
    mem = strip(mbrs.i)                                           
    pdsmem = "'"||pds || "("||mem||")"||"'"                       
   "alloc da("pdsmem") f(mylist1) shr reuse"                       
   "execio 1 diskr mylist1(stem inlist1. finis"                   
   "free dd(mylist1)"                                             
    if pos("IDENTIFICATION", inlist1.1) > 0 &,                     
       pos("DIVISION", inlist1.1) > 0 then                         
       cobol_pgm_count = cobol_pgm_count + 1 
    else nop                                 
return     
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Thu Mar 12, 2009 5:31 pm
Reply with quote

Jobin,

'ID DIVISION' is also acceptable syntax.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Thu Mar 12, 2009 8:41 pm
Reply with quote

Hello,

There is also no requirement that the id/identification division statement be the first line of code in the source member. . . Compiler directives and comments are also sometimes found at the beginning of a module.
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Thu Mar 12, 2009 10:21 pm
Reply with quote

To further complicate matters, remember that in COBOL, whenever one space is allowed, more than one is also allowed.
Back to top
View user's profile Send private message
jobin thomas

New User


Joined: 19 Aug 2008
Posts: 15
Location: Bangalore

PostPosted: Fri Mar 13, 2009 11:48 am
Reply with quote

Thanks guys for your inputs!

It's all dependent upon the coding pattern followed (ie.., if any coding standards are followed).
Back to top
View user's profile Send private message
raghavmcs

Active User


Joined: 14 Jul 2005
Posts: 105

PostPosted: Mon Mar 16, 2009 9:29 pm
Reply with quote

Thanks Jobin for the implementation.
Thanks a lot
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 Replace each space in cobol string wi... COBOL Programming 3
No new posts Using API Gateway from CICS program CICS 0
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
Search our Forums:

Back to Top