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: 26
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

Active Member


Joined: 29 Apr 2008
Posts: 924
Location: Maryland

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: 26
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: 2448
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: 26
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: 1015
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
Warnings : 1

Senior Member


Joined: 07 Feb 2009
Posts: 1238
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 Execute step regardless of previous s... JCL & VSAM 2
No new posts Error 0C1 Reason Code 1 with branch i... PL/I & Assembler 3
This topic is locked: you cannot edit posts or make replies. Passing a field name to COBOL program COBOL Programming 10
No new posts COBOL Performance Tuning COBOL Programming 6
No new posts JCL for replacing code in Cobol JCL & VSAM 7
Search our Forums:

Back to Top