COBOL User Groups Header Graphic COBUG Logo COBOL Programming  Header
Home to COBOL | Website Search | Forums | Join COBUG | Change COBUG Account | Donations | Advertise with us | Contact us | About us | Site Map

 COBOL Jobs List:  Companies Using COBOL

 >  COBOL Job Listing
 >  COBOL Job Seekers
 >  Employers
 >  Interview Questions
 >  COBOL Job Resources

COBOL Resources
 >  Blogs
 >  COBOL Books
 >  Computer Timeshare
 >  COBOL Examples
 >  Forums
 >  Knowledge Bases
 >  Magazines
 >  Manuals
 >  Portals
 >  Support
 >  COBOL Syntax/Commands
 >  COBOL Training
 >  COBOL Tutorials
 >  User Groups
 >  White Papers

COBOL Software
 >  Change Management
 >  COBOL Compilers
 >  Data Access
 >  Database
 >  Documentation
 >  COBOL Editors
 >  File Conversion
 >  GUI
 >  Legacy Migration
 >  Legacy Modernization
 >  Mainframe Security
 >  Report Generators
 >  COBOL Sort
 >  Terminal Emulators
 >  Test
 >  Tools
 >  Trans. Processing

COBOL Information
 >  Events
 >  News Articles
 >  Newsletters
 >  Product News
 >  COBOL Standards

COBOL Report Generator
Print graphics in COBOL reports with the reporting tool RPV Reports. Insert graphics (images, photos, logos, charts, etc.) in your plain text file COBOL reports to improve the quality of your reports. See how the report generator RPV Reports can be used to print graphics in your plain text COBOL reports.

Mainframe Training
The Mainframe COBOL Training Boot Camp is an intensive 10-day training course that allows you to function as a COBOL programmer in an IBM Enterprise mainframe environment. A comprehensive offering of instructor led online and onsite mainframe training courses are provided including COBOL, CICS, DB2, Easytrieve, FileAid, ISPF, JCL, VSAM, IMS, JES2, REXX, SysPlex, SMP/E, Xpeditor and z/OS, giving you the foundation to function as a mainframe programmer.

COBOL Analysis Tools
Analyze, debug and understand your COBOL programs with our set of COBOL Analysis Tools.

Analyze your COBOL programs with our Error Checker tool which checks for logic errors that are not detected by COBOL compilers.

Analyze the IF ELSE structure of your COBOL programs with our Nested If Analysis tool.

Understand the logic of your COBOL programs from top to bottom and bottom to top with our Top Down Logic Progression and Bottom Up Logic Regression tool.

Generate an easy to understand database cross reference listing with our ADABAS and DB2 File References tools.

COBOL Email List Rental
You can reach a highly targeted, qualified, opt-in audience of COBOL users by renting the COBUG email list. Contact us today for our email list rental rates.

Website Advertisement
Advertise on the COBUG website and reach tens of thousands of COBOL users. Increase your sales leads. Contact COBUG at for advertising rates.

Support COBUG
COBOL Donation Graphic

COBOL Write - Can you use Write AFTER and BEFORE commands together - COBOL Language Forum

COBOL Language [ return ]
From Message


Subject: after/before advancing

I'm a student and I need to print out a detail line after skipping a line after writing the previous record. I know you do this by
But I also need to skip 2 lines after that.

Can I use the AFTER and BEFORE commands together somehow? I've tried
and various combinations of that.

I still keep getting errors. How do I do this? Is there another way?

I should explain what I mean in more detail.
This is a program that has different levels of totals using control breaks. It prints out each detail line for one customer number in a region and then the totals for that customer. Then it prints out detail lines for the next customer number in the same region and then the totals for that customer. After the region number changes, it prints out another line for totals from the region, which includes all customer numbers in that region. At the very end, it prints out grand totals.
I'm fine with the control break logic and the program runs correctly. I'm only having trouble with the line spacing. The report layout I was given shows a blank line after the last detail line in each customer number record, then "TOTAL FOR CUSTOMER ######: ..." and then 2 blank lines before starting the detail lines for the next customer number.

Thank you for your help.


RE: after/before advancing

To print the required blank lines after your totals:

Move spaces to customer-record.
Write customer-record before advancing 2 lines.

i.e. it is o.k. to write blank print lines for spacing.


RE: after/before advancing

together. As a matter of fact the BEFORE option is seldom even used.

To avoid excessive moves in the PROCEDURE DIVISION, in WORKING STORAGE code the following.

01 space-line pic x(132) value spaces.

Each time that you need to write spaces in the PROCEDURE DIVISION code

WRITE print-record from space-line after 2 or 3 etc.

Whats this "from" business? from = move spaces to
Only want to advance 1 line? One is the default so you're coding more than you need with after 1
You can probably guess that you can use the following option when advancing to the next page.

WRITE from space-line after page.

[ Go to Top of Page ]
Visual COBOL Ad
COBOL Documentation Tool - Marble COBOL on PC Ad
COBOL Applicatiom Modernization - Fresche Legacy Ad
COBOL Application Modernization - EvolveWare Ad
COBOL Interpreter - McKinney Ad
COBOL Sort, COBOL Tools - IRI, The CoSort Company Banner Ad

COBOL Job Seekers

COBOL Jobs Looking for a COBOL job? Submit your resume here and have it viewed by employers and recruiters hiring for COBOL positions.

Employers & Recruiters

Post COBOL Jobs Do you need to fill a COBOL position? Post your COBOL jobs here and find the most qualified COBOL candidates to fill your COBOL position.

Call for Articles

COBOL Newsletters Articles are being sought for the COBUG newsletters.
Will you help us in our efforts to provide newsletters for the COBOL community at large? Contribute to the COBUG newsletters! Answer this call for COBOL and related legacy articles.


COBUG Become a part of COBUG and the global COBOL community today. Join Now ...


COBOL Forum Try our COBOL forums for help!
Let the COBUG members help you. Post your issues!

[Go to Top of Page]

COBOL (c) Information Computing Services. All Rights Reserved. COBOL