Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Rexx tool for cobol code standard checking

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: Rexx tool for cobol code standard checking
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: 6967
Location: porcelain throne

PostPosted: Sat Oct 30, 2010 6:51 pm    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10256
Location: italy

PostPosted: Sat Oct 30, 2010 7:56 pm    Post subject: Reply to: Rexx tool for cobol code standard checking
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    Post subject: Reply to: Rexx tool for cobol code standard checking
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

Site Director


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

PostPosted: Sun Nov 21, 2010 12:25 am    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10256
Location: italy

PostPosted: Sun Nov 21, 2010 12:55 am    Post subject: Reply to: Rexx tool for cobol code standard checking
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    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
This topic is locked: you cannot edit posts or make replies. Need help on If condition continuatio... ashok_uddaraju CLIST & REXX 4 Fri May 19, 2017 8:55 am
No new posts Job failing with USER = 4093 REASON C... Pradeepa S ABENDS & Debugging 1 Wed May 17, 2017 3:35 pm
This topic is locked: you cannot edit posts or make replies. Cobol GUI (like Editor) Kala Mainframe COBOL Programming 14 Wed May 10, 2017 12:30 pm
No new posts IMS T-Pipe queue counts in a COBOL Pr... Siva NKK Kothamasu IMS DB/DC 0 Tue May 09, 2017 6:31 pm
No new posts COBOL Code Parsers and Lineage Establ... balimanja COBOL Programming 2 Tue May 02, 2017 3:30 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us