Example of accept statement, COBOL Programming

Example of Accept statement:

For illustration, ACCEPT FLAG-A can be specified to read the value of the FLAG_A from the console. It may be keep in mind that no file definition is essential.

The mnemonic-name option is an implementer-dependent. The hardware machine from which the data is to be read is to be equated to the mnemonic name in the SPECIAL-NAME APARAGRAPH. For illustration, the following entry in the SPECIAL-NAMES paragraph TYPEWRITER-1 IS CONTROL-DATA may associate the mnemonic name CONTROL-DATA with the supposed implementor-name TYPEWRITER-1. 

The ACCEPT FLAG-1 FROM CONTROL-DATA 

will read the value of the FLAG-A from the hardware device specified by the TYPEWRITER-1.

The DATE, DAY & TIME options are some of the new features introduced in the ANSI 74 COBOL. 

The DAY option returns the 6-digit present date in the form YYMMDD where YY, MM and DD stand for year, month & day respectively. The DAY option returns a 5-digit present date in the form YYDDD where YY stands for the year and DDD stands for the day of the year (001 to 365). The TIME returns an 8 -digit time in the form of HHMMSSTT where HH, MM, SS, TT specifies hour, minute, second & hundreds of a second respectively. For all the 3 options, the returned value is transferred to the identifier (in the ACCEPT statement) according to the rules of the MOVE statement. For illustration,

ACCEPT THIS-DAY FROM DATE 

will transfer the value of the present date to the THIS-DAY.

 

Posted Date: 10/16/2012 5:42:05 AM | Location : United States







Related Discussions:- Example of accept statement, Assignment Help, Ask Question on Example of accept statement, Get Answer, Expert's Help, Example of accept statement Discussions

Write discussion on Example of accept statement
Your posts are moderated
Related Questions
Display control verbs in Cobol

Concept of a two-dimensional table: Concept of a two-dimensional table can be easily extended to tables having three or more dimensions. The Handling of tables up to three dim

IF STATEMENT: The easiest form of the IF statement is  IF condition-1 statement-1 where the condition-1 may be any one from the shown below. When the condition-1

SEQUENTIAL FILE CREATION AND REWRITING: We have to write a program to create a student file with just two fields: sno i.e. Student Number and same i.e. Student Name. Add a few

Object-Computer - Configuration section: The computer name specifies a specific computer on which the object program is to be executed. The MEMORY SIZE is used to show the

We have input file, record layout is EMP ID (6 char) , EMP NAME (20 char), Designation (3 char),Salary (5 digit) Base Branch (10char) Grade (3 Alphanumeric). This is the input f

Identification Division: The Identification Division is the first division of each and every COBOL source program. The paragraph PROGRAM-ID is necessary in most of the mac

PROGRAM FOR SUBTRACT VERB: We have to write a simple program to elaborate the SUBTRACT verb. You can also use edit characters in the program. Identification division. Pr

DISPLAY STATEMENT:   The function of the DISPLAY statement is just opposite to that of the ACCEPT statement. It is used to display the low-volume results on the operator's co

Illustration of Multiply verb: (a)  MULTIPLY A BY B. In this situation the value of A & B will be multiplied and the product will be stored in B.  The decimal point locatio