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

Indent cobol code


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Renato Zangerolami

New User


Joined: 06 Dec 2019
Posts: 28
Location: Brazil

PostPosted: Thu Feb 13, 2020 12:53 am
Reply with quote

Can anyone tell me if there is any resource where it is possible to indent Cobol code or is it necessary to create a program for that?
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2018
Location: USA

PostPosted: Thu Feb 13, 2020 1:13 am
Reply with quote

Formatting COBOL code elements

Why does COBOL have to be indented?
Back to top
View user's profile Send private message
Renato Zangerolami

New User


Joined: 06 Dec 2019
Posts: 28
Location: Brazil

PostPosted: Thu Feb 13, 2020 1:30 am
Reply with quote

where I work there are some rules, eg:
Pic, section, exit .. starts at column 40
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Thu Feb 13, 2020 2:25 am
Reply with quote

Googling "COBOL SOURCE CODE BEAUTIFIER" gives some possible options.
Back to top
View user's profile Send private message
Renato Zangerolami

New User


Joined: 06 Dec 2019
Posts: 28
Location: Brazil

PostPosted: Thu Feb 13, 2020 2:28 am
Reply with quote

Thank you Nic.
Back to top
View user's profile Send private message
Phrzby Phil

Senior Member


Joined: 31 Oct 2006
Posts: 1042
Location: Richmond, Virginia

PostPosted: Fri Feb 14, 2020 9:31 am
Reply with quote

Just a side note on indentation.

COBOL doesn't give you room to indent too much.

But when I used the PL/I Optimizing compiler (1980's and 90's, but most likely still the same), the max compiler input record length was 100, with just column 1 reserved for carriage control, so 99 characters for source code allowed for very deep indentation.

Another side note - I had an intern (rising college senior in systems engineering) working with me on one one job around 2014, and while working with text files I asked her if she knew what a carriage was. All she knew was the horse drawn vehicle. lol.
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Fri Feb 14, 2020 5:12 pm
Reply with quote

I think Enterprise PL/I has been changed fairly recently to allow an input LRECL=200 for source. I personally don't see why it's really necessary, having been used to breaking up lines since forever.
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts run rexx code with jcl CLIST & REXX 15
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Compile rexx code with jcl CLIST & REXX 6
Search our Forums:

Back to Top