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

Rexx tool for cobol code standard checking


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

New User


Joined: 03 Oct 2010
Posts: 2
Location: Kolkata

PostPosted: Sat Oct 30, 2010 6:26 pm
Reply with quote

Hi ,
I am looking for an rexx tool which will check whether a cobol program is written on a standard basis or not.means it will check for indentation and Para naming order like perform 2000-para should be before perform 3000-para and shouldn't be the reverse.And the section checking.If file is used then should be in the select-assign clause,FD section and properly open,write and close .

I will be very glad if anybody can share your thoughts in these regards.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Sat Oct 30, 2010 6:51 pm
Reply with quote

depends on:
  • invoke during edit/view mode
  • invoke as a batch job
  • make corrections
  • just generate an error list
  • insert error messages

my experience with writing such tools is that i found writing it in COBOL or ASSEMBLER was easier, due to the probable required addition of additional checks.

also, what happens to the source after the check.
I found that the only way to enforce programming standards was to introduce the 'check program' in the standard compile jcl and if deviations to the standards were found, insert error messages in the source file (without comment notation), before the compile step, so that the source could not be compiled.

without the ability to enforce standards, a second best method would be to write several REXX edit macros each having a specific job
  • would create the indentation required
  • flag unordered section/para names
  • flag improper Performs (not allow the thru option
  • flag goto's that were not to a para/section exit - eliminate potential permanent loops
  • flag IF's and EVALUATE's that exceeded 3-levels of nesting
  • modify code lines to insure only one verb and one reference per line - this helps with missing OF/IN's
  • program-id/pds member name mismatch


good 3rd party standards checkers cost quite a bit.
so, decide
  • what your standards are going to be
  • if you are really going to enforce standards
  • how you are going to enforce the standards


my suggestion is a lot of REXX edit macros, each performing a single task, all CALLed from a Control EDIT Macro
or
write it in COBOL or ASSEMBLE or PL1, so that the program is easier to maintain.

I have nothing at all against REXX Scripts
(i have more than 800 in my personal library)
but something as complex as a source program standards checker
does not belong in one REXX script.

And, spend some time googling.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Sat Oct 30, 2010 7:56 pm
Reply with quote

google for cobol beautifiers

such a tool belongs to the category ...
do it right or do not do it at all

in rexx it would be easy to build a token parser ...
do something based on the occurrence of some tokens/strings
pretty easy to do it for jcl

for cobol is not that easy
for cobol something has been done by IBM itself for SCLM in order to analyze program dependencies ( COPY and CALL )

look at FLMLRCBL in Your ISP.SISPSAMP to see the relative complexity of such a simple task

for something more complicated then a language parser ( at least partial ) must be built
Back to top
View user's profile Send private message
rakhi12

New User


Joined: 03 Oct 2010
Posts: 2
Location: Kolkata

PostPosted: Sat Nov 20, 2010 10:59 pm
Reply with quote

Hi,
Actually i want to invoke the rexx code during edit mode in the command line and that would create the indentation required in the cobol program.
Means if anyone write the code like this :
MOVE 10 TO NUM PERFORM 100-PARA THRU 100-EXIT.
then the rexx code will break the line and make the correct indentation like
MOVE 10 TO NUM
PERFORM 100-PARA THRU 100-EXIT.
...

and it will also check the para number ordering whether it is in the ascending order,flag IF's and EVALUATE's that exceeded 3-levels of nesting etc etc.
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: Sun Nov 21, 2010 12:25 am
Reply with quote

Hello,

Pretty much everyone understands what you want to have.

What has been suggested is that you should re-consider trying to implement something that will do all that is needed.

There are products available that do "standards checking" but they are not free.

People who are quite expert at rexx would not undertake this - the payback would not be worth the investment needed to create it.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Sun Nov 21, 2010 12:55 am
Reply with quote

the effort would be the same required to build an AST and print it!
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 Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
Search our Forums:

Back to Top