Example of accept statement, COBOL Programming

Assignment Help:

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.

 


Related Discussions:- Example of accept statement

File description- fixed-length records, FILE DESCRIPTION- FIXED-LENGTH RECO...

FILE DESCRIPTION- FIXED-LENGTH RECORDS: The normal characteristics of a file are explained in the file description (FD) entry of the DATA DIVISION.

Rules for occurs clause, RULES FOR OCCURS CLAUSE: The rules apply for ...

RULES FOR OCCURS CLAUSE: The rules apply for the OCCURS clause and the subscripts are as shown below. (1) The integer in the OCCURS clause should be a positive integer.

Restrictions - procedure in statement, There are some restrictions when the...

There are some restrictions when these procedures are used. (i) The Procedure should not contain any SORT/MERGE statement. (ii) An explicit transfer of the control outside

Illustration of subtract verb, Illustration of Subtract verb: (a) SUBT...

Illustration of Subtract verb: (a) SUBTRACT A FROM B. This illustration means that the value of A will be subtracted from the value of B and the subtracted result will be s

Case study, cobol program for generate a eb bill

cobol program for generate a eb bill

Read statement, READ STATEMENT: The aim of this verb is to make availa...

READ STATEMENT: The aim of this verb is to make available the next logical record from the input file. It is important to note the meaning of the "next" logical record in the

Credit and debit sign - edit characters for numeric data, CR and DB (Credit...

CR and DB (Credit and Debit Sign): The two characters that is CR or DB symbol may appear only at the rightmost place of the picture. They are similar to the minus sign edit ch

Negated simple condition, NEGATED SIMPLE CONDITION: Any of the easy co...

NEGATED SIMPLE CONDITION: Any of the easy condition explained can be preceded by the logical operator NOT. The consequence of placing the operator NOT before an easy condition

Move verb - cobol programming, Introduction to MOVE Verb: The aim of th...

Introduction to MOVE Verb: The aim of this section is to introduce the learner how to move data from one place to the other place in the memory. This is completed with the help

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd