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

Comparison of numeric operands - relational condition , Comparison of Numer...

Comparison of Numeric Operands: We are well-known with the kind of the relational condition where both the operands are numeric. The comparison in this situation is algebraic

Nested if statement, NESTED IF STATEMENT:   The then and else stateme...

NESTED IF STATEMENT:   The then and else statement of an IF statement can hold other IF statements. The involved IF statements in their turn may also hold other IF statements

Conditions-name condition, CONDITIONS-NAME CONDITION:   The condition...

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

Program, calculate simple interest

calculate simple interest

Write statement - sequential files, WRITE statement: The WRITE stateme...

WRITE statement: The WRITE statement for tape and sequential-disk files has the syntax shown below. WRITE            record-name      [  FROM    identifier   ] As a resu

File description for the relative and indexed files, File Description for t...

File Description for the Relative and Indexed Files: The FD entry for a relative or an indexed file is similar to that of a sequential file. Some compilers do not permit varia

Kirat da satikar, bal majduri ik kanuni apradh hai is de bavjud bache ,ghra...

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

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

Valid and invalid word - cobol words, Valid and Invalid Word - Cobol words:...

Valid and Invalid Word - Cobol words: Valid Word             Invalid Word & Reason emp-sal                  -pay   ( it starts with a hyphen)  TOTAL MARK (blank space em

On size error option, ON SIZE ERROR OPTION:   If after an arithmetic ...

ON SIZE ERROR OPTION:   If after an arithmetic expression, the result exceeds the highest value which can be accommodated in the result; this error is termed as size error. T

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