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
 
Identifying Easytrieve and CObol program

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: Identifying Easytrieve and CObol program
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    Post subject:
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: 6968
Location: porcelain throne

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

Jobin,

'ID DIVISION' is also acceptable syntax.
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 Mar 12, 2009 8:41 pm    Post subject:
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    Post subject:
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    Post subject: Reply to: Identifying Easytrieve and CObol program
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Identifying Interfaces in CICS/mainframe Ashishpanpaliya CICS 5 Fri Oct 13, 2017 3:21 pm
No new posts IEW2456E error when link-editing a C ... Senthilraj JCL & VSAM 0 Fri Oct 13, 2017 3:12 pm
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 Accessing CICS tran with map from JCL... navdeepaggarwal CICS 5 Tue Oct 03, 2017 6:15 pm
No new posts Assembler Macro Copybook converted to... Ziquilix PL/I & Assembler 4 Tue Sep 26, 2017 3:07 am

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