Company InformationOur COBOL SolutionsCOBOL Services and TrainingSupport for our CustomersAcucorp and COBOL EventsAcucorp's Partners


















< previous      next > Print this page  

Applying format to a numeric edited-field as it is being entered.

February 29, 1996
Author: Eduardo Mendiola
Date: 2/29/96
Category: programming
Keywords: accept,edited-updates
Summary: Applying the format to a numeric edited-field as it is being entered

Normally, when accepting numeric edited fields, such as a date-field (i.e. PIC 99/99/99) or an amount field (i.e. PIC ZZZ,ZZZ.99), the format gets applied to it after the cursor leaves the field (using the screen section) or when the ACCEPT statement terminates (not using the screen section).

Some applications require that the format be applied to a numeric edited field as it is being entered by the user.

To accomplish this, you must add the following configuration variable to your cobol configuration file (CBLCONFIG):

  SCREEN EDITED-UPDATES=FORMATTED,AUTO-PROMPT

The value will always appear to the user in its "final" form. This is similar to the way numbers are entered on most calculators.

  identification division.
  program-id. testit.
  data division.
  working-storage section.
  01 date-field pic 99/99/99.
  01 amount pic zzz,zzz.99.
  01 customer pic x(20).

  screen section.
  01 screen-1.
    05 "Date : " line 5 col 5.
    05 using date-field col + 5.
    05 "Amount : " line 7 col 5.
    05 using amount col + 5.
    05 "Customer: " line 9 col 5.
    05 using customer col + 5.

  procedure division.
  main-logic.
    display window erase.
    display screen-1.
    accept screen-1.
    stop run.

####

Acucorp, extend and ACUCOBOL are trademarks or registered trademarks of Acucorp, Inc. All rights reserved. All other trademarks are the property of their respective owners.

 

 

Contact | Site Map | | Legal | Trademarks | Privacy | Print this page
Acucorp, Inc., 9920 Pacific Heights Blvd., San Diego, CA 92121, +1 858.795.1900
© 1999-2008, Acucorp, Inc. All rights reserved.


Get the most recent Code Updates
Download an Evaluation of ACUCOBOL- GT
View recorded Webinars and demos
Download the latest version of Acucorp News
Find out about the latest Training Opportunities
Language