MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

COBOL Indentation

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
ramu_mohan21
Beginner


Joined: 29 Jun 2004
Posts: 106
Topics: 41
Location: Bangalore, INDIA

PostPosted: Fri Jun 04, 2010 4:12 am    Post subject: COBOL Indentation Reply with quote

Hi All,
Do we have any tool which does COBOL Code Indentation.
_________________
Best Regards,
----------------
Rammohan Pabba
Software Engineer
Back to top
View user's profile Send private message Send e-mail
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Fri Jun 04, 2010 5:11 am    Post subject: Reply with quote

this link has a couple of mainframe apps that will do what you want, but they are not free:
http://www.cobug.com/cobug/docs/editors0036.html

not a lot of stuff (nothing for free) for the mainframe.

lots of stuff for the pc. google.

I have written my own ISPF Edit Macros to accomplish this.

but I rarely type, usually copy & paste.
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12370
Topics: 75
Location: San Jose

PostPosted: Fri Jun 04, 2010 10:41 am    Post subject: Re: COBOL Indentation Reply with quote

ramu_mohan21 wrote:
Hi All,
Do we have any tool which does COBOL Code Indentation.


what is code indentation? is it related to having pic clauses in 40th column ,paragraph names in column 8 and all the sql statements if any to start in col 12 ???

Kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
papadi
Supermod


Joined: 20 Oct 2009
Posts: 594
Topics: 1

PostPosted: Fri Jun 04, 2010 4:43 pm    Post subject: Reply with quote

Indentation makes the code to appear like an outline - indentation is by "level"

For Data Division something like:
Code:

01  some-stuff.
    05 part-1       pic x(10).
    05 part-2.
       10 fld1      pic xx.
       10 fld2      pic x(7).

For Procedure Dividion:
Code:

       my-para.
           if something = 'AASSDD' and
              something-else not = 'VALUE'
              perform some-other-para
           end-if

And so on for readability.
_________________
All the best,

di


Last edited by papadi on Mon Jun 07, 2010 1:08 am; edited 1 time in total
Back to top
View user's profile Send private message
hari_uss
Beginner


Joined: 19 Dec 2002
Posts: 78
Topics: 6
Location: Trivandrum, India

PostPosted: Mon Jun 07, 2010 12:39 am    Post subject: Reply with quote

I like the recommendations here
http://home.swbell.net/mck9/cobol/style/indent.html
Back to top
View user's profile Send private message Send e-mail
Anuj Dhawan
Intermediate


Joined: 19 Jul 2007
Posts: 298
Topics: 7
Location: Mumbai,India

PostPosted: Tue Jun 08, 2010 9:34 am    Post subject: Reply with quote

Why not just do it while writing the code? I never found it that tough...Smile
_________________
Regards,
Anuj
Back to top
View user's profile Send private message
hari_uss
Beginner


Joined: 19 Dec 2002
Posts: 78
Topics: 6
Location: Trivandrum, India

PostPosted: Thu Jun 10, 2010 12:58 am    Post subject: Reply with quote

Not applicable for systems which are 20-30 years old. You can expect anything and everything there.
Back to top
View user's profile Send private message Send e-mail
misi01
Advanced


Joined: 02 Dec 2002
Posts: 627
Topics: 176
Location: Stockholm, Sweden

PostPosted: Thu Aug 12, 2010 3:57 am    Post subject: Reply with quote

I have code for the PC that is free. One "problem" you have on the m/f is the fact that if the code is written with multiple if/else/if/else etc etc, indenting the code would end up trying to write details "beyond" column 80.

The code I have indents evaluates/ifs/strings and indents as must as necessary - the point being that it's easy for you to then see which blocks of code belong to which verbs.

Send me a private note if it's of interest.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group