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
Major difference between file and array how does record read from array and file why we are not preparing array for real time

Comparison of Numeric Operands: We are well-known with the kind of the relational condition where both the operands are numeric. The comparison in this situation is algebraic

PICTURE specification: The size of a group item is equivalent to the total of the sizes of all the subordinate elementary items. The group item class is alphanumeric. The i

PROGRAM FOR PERFORM - VARYING: We have to write a program to elaborate PERFORM ...VARYING Identification division. Program- id. PerfVary. Environment division. Dat

Illustration of Perform with varying option: A) Perform para-3 varying the k from 1 by 1 until k > 10. Here para-3 will be constantly executed 10 times (For k=1,2,3, .....1

Illustration of if- else statement: IF OK-BALANCE NEXT SENTENCE ELSE MOVE 2 BALANCE-CODE In this illustration, the OK-BALANCE is a condition name. No action is specific if

PROGRAM FOR MOVE CORRESPONDING: We have to write a simple program to demonstrate Move Corresponding. identification division.   program- id.   environment division.

Second form of Divide verb: The second form of this verb is as shown below: In this situation the identifier-1 or numeric- literal-1 will be divided by identifier-2 or

WRITE statement: The WRITE statement for tape and sequential-disk files has the syntax shown below. WRITE            record-name      [  FROM    identifier   ] As a resu

PROGRAM FOR RENAMES CLAUSE: identification division. program- id. environment division. data division. working-storage section. 01 emp.      02 empdet.