Program for screen section with files, COBOL Programming

Assignment Help:

PROGRAM FOR SCREEN SECTION WITH FILES:

identification division.

  program- id.

  environment division.

         input-output section.

  file-control.

    select stu- file assign to disk

    file status is fs.

  data division.

  file section.

  fd stu- file

    label records are standard

    value of file- id is 'stu.dat'.

  01 stu-rec.

     02   name  pic x(20).

           02   mark  pic 9(3).

  working-storage section.

          01   ans  pic  x value space.

  01   eof  pic  x value space.

  01   fs   pic  x(2) value spaces.

  screen section.

          01 get-screen.

              02   line 3 column 5 value "Name : ".

       02   line 3 column 15   pic x(5)

                          to  name auto bell reverse-video.

              02   line 5 column 5 value "Mark : ".

       02   line 5 column 15  pic 9(3) to mark bell blink.

              02   line 7 column 5 value "Continue [y/n] : ".

       02   column  plus 3  pic x to ans  bell blink.

    01 b-screen.

              02  blank screen.

          01 put-screen.

              02   line 3 column 25 value "Name : " highlight.

       02   column plus 2 pic x(20) from name blink.

              02   line 5 column 25 value "Mark : "  blink.

              02   column plus 2 pic 9(3) from mark underline.

        procedure division.

  p-1.

        display b-screen.

        open output stu-file.

        display " File Staus Value  ... Exhibit ... display..".

        exhibit fs.

        display fs.

        display " Press a Key!".

        accept ans.

                  perform g-w-para until ans = 'n'.

        close stu-file.

 

        move space to ans.

        open input stu-file.

        read stu- file at end move 'y' to eof.

                  perform disp-para until eof  = 'y'.

        close stu-file.

        stop run.

        g-w-para.

        display b-screen.

        display get-screen.

        accept get-screen.

        write stu-rec.

        disp-para.     

        display (1 1) erase.

                  display put-screen.

        display (15 5) "Press any Key ! ".

        accept ans.

        read stu- file at end move 'y' to eof.


Related Discussions:- Program for screen section with files

Write statement - indexed files, WRITE STATEMENT: The records are wri...

WRITE STATEMENT: The records are written to be logical place as determined from the value of the record key. The INVALID KEY condition occurs in the cases shown below: (i)

Program for if -else, PROGRAM FOR IF -ELSE: We have to write a program...

PROGRAM FOR IF -ELSE: We have to write a program to check whether the given number is ODD or EVEN. You can use IF..ELSE. Identification division. Program- id. IfElse.

Identification division - cobol programming, Identification Division: ...

Identification Division: The Identification Division is the first division of each and every COBOL source program. The paragraph PROGRAM-ID is necessary in most of the mac

Relational condition - cobol programming, RELATIONAL CONDITION:   We ...

RELATIONAL CONDITION:   We know that a relational condition specifies a comparison between two operands and has the form.     Operand-1    relational-operator   operand-2

Example of file-control, Example of File-control: The assign clause as...

Example of File-control: The assign clause assigns a specific physical peripheral device name to a file. The physical peripheral device are machine-dependent. We use the devic

Perform statement, PERFORM STATEMENT:   The PERFORM statement can be ...

PERFORM STATEMENT:   The PERFORM statement can be used to execute the group of consecutive statements written elsewhere in the program. We refer to this group of statements a

Example of compound condition, Example of compound condition: In commo...

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:

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

Filler clause - cobol programming, FILLER CLAUSE: Consider the stateme...

FILLER CLAUSE: Consider the statements as shown below: 1)  01    f    pic     x(80)  value    all "-". This statement origins a line of 80 characters filled with "-"

Illustration of if- else statement, Illustration of if- else statement: ...

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

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