Program for condition names , COBOL Programming

PROGRAM FOR CONDITION NAMES:

We have to write a simple program to demonstrate Condition names usage.

 identification division.

  program- id.

  environment division.

  data division.

  working-storage section.

  01   ms     pic  9(2).

  88   s    value 0 thru  9 .

  88   m    value 10 thru 99.

  procedure division.

  p-1.

    display(1 1) erase.

    display(5 5) "Enter Marriage Status : ".

    display(7 5) " 0 to 9   .... Single Person ".

    display(8 5) " 10 to 99 .... Married Person".

    accept ms.

    if s   display(10 5) "Single".

    if m   display(10 5) "Married".

    stop run.  

Posted Date: 10/18/2012 2:04:32 AM | Location : United States







Related Discussions:- Program for condition names , Assignment Help, Ask Question on Program for condition names , Get Answer, Expert's Help, Program for condition names Discussions

Write discussion on Program for condition names
Your posts are moderated
Related Questions
Example of Perform statement: PERFORM BEGIN-CALCULATION THRU END-CALCULATION. Assume, BEGIN-CALCULATION and END-CALCULTION is paragraph names. The execution of the PERFORM

PROGRAM FOR COMPUTE VERB: We have to write an easy program to elaborate the COMPUTE verb.  Identification division. Program- id. compverb. Environment division. Da

Sign - Picture clause: The numeric data item can be signed or unsigned. If a numeric data is regarded as unsigned then during the execution these unsigned data items are treat

Illustration of perform statement: PERFORM    CALCUALTE-TAX. In this illustration, the CALCULATE-TAX is either a section name or paragraph name. Assume that it is a section

FILE STATUS clause: This clause has been involved in the above syntax for completeness. The ORGANIZATION, REVERSE, ACCESS and STATUS clause can be specified in any order.

DELETE STATEMENT: The format of the delete statement is as shown below: DELETE   file-name RECORD   [  ;   INVALID   KEY  imperative-statement  ] Whenever the ACCESS MOD

Format for COBOL Programs: The COBOL is a high-level language. Therefore, a COBOL program can be executed on a computer for which a COBOL compiler exists. The compiler transla

PROGRAM USING OCCURS CLAUSE: We have to write a simple program to demonstrate Occurs Clause. Get the employee details for 3 persons and compute the total salary. identifica

OPEN statement: We know that the processing of a file should start with the execution of an OPEN statement. The file can be opened in any one of the 4 open modes - INPUT, OUTP

Example of compound condition: In common, a compound condition has the form which is as shown below: Where condition-1 & condition-2 can be any one of the below: