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

Illustration of search verb, Illustration of Search verb: To illustrat...

Illustration of Search verb: To illustrate the other use of SEARCH verb, assume we wish to search the similar tab to find the number of persons whose deposited amount is more

Illustration of perform with varying option, Illustration of Perform with v...

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

Column and field in cobol program, Column and Field in COBOL program: ...

Column and Field in COBOL program: In COBOL there are 2 types of entries termed as margin A and margin B entries. The Margin A entries start from the column 8, 9, 10 or 11 and

Program for inventory , PROGRAM FOR INVENTORY  We have to write a progr...

PROGRAM FOR INVENTORY  We have to write a program to update the inventory file. Consider 2 files,viz, invfile an tranfile. Invfile has 3 fields pno,name,qty. Tranfile has 3 fil

Program to demonstrate merge verb, PROGRAM TO DEMONSTRATE MERGE VERB: ...

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

Program for multiply verb, PROGRAM FOR MULTIPLY VERB: We have to write...

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

Indexed sequential files, INDEXED SEQUENTIAL FILES: In the indexed seq...

INDEXED SEQUENTIAL FILES: In the indexed sequential files which are also known as indexed files, the records are stored in the sequence order generally in ascending order. In

.QUADRATIC EQN ROOTS, TO WRITE A QUADRATIC EQN ROOTS ARE COMPLEX IN COBOL P...

TO WRITE A QUADRATIC EQN ROOTS ARE COMPLEX IN COBOL PROGRAM

Character set - cobol programming, Character Set: To study any languag...

Character Set: To study any language, first one should know the alphabets of the language and they are termed as character set in general. There are 50 different characters in

Program for divide verb, PROGRAM FOR DIVIDE VERB:   We have to write ...

PROGRAM FOR DIVIDE VERB:   We have to write an easy program to elaborate DIVIDE verb. You can also use edit characters in the program. Identification division. Program-

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