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
Figurative Constants: The Figurative constants have several fixed names and the compiler recognizes these names and it sets up the equivalent values in the object program.

SPECIAL-NAMES: This paragraph is used to associate some hardware names to the user-specified mnemonic names. This paragraph is elective in all compilers. The format of this pa

OPEN STATEMENT: Whenever a READ or a WRITE operation is executed on a file, then it should be open. The opening of a file may be completed with the help of the OPEN verb. With

bal majduri ik kanuni apradh hai is de bavjud bache ,ghra,hotla,road, kam karn lai majbur han bacheya te mapeya nu parhai val prerit karn lai ik bashan teyar kro

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

COMPOUND CONDITION: The two simple conditions can be connected by the logical operators AND or OR to form a compound condition (also termed as combined condition). When two co

PROGRAM TO DEMONSTRATE MERGE VERB: The two files for which a record having 2 fields viz. Account Number and Name are already available. Now Merge these two files and create a

CONDITIONS-NAME CONDITION:   The condition name is an entity which itself is a condition and these can have either a true or false value. Though, a condition name cannot be d

Illustration of simple sort verb: Illustration: Suppose that we have a card file with the following records description in the data division. The names of the work fil

Display control verbs in Cobol