rp21

sortingSeq

Sep 16th, 2015
558
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.        IDENTIFICATION DIVISION.
  2.        PROGRAM-ID MERGE.
  3.        ENVIRONMENT DIVISION.
  4.        INPUT-OUTPUT SECTION.
  5.        FILE-CONTROL.
  6.            SELECT F1 ASSIGN TO DISK
  7.            ORGANIZATION IS SEQUENTIAL
  8.            ACCESS MODE IS SEQUENTIAL.
  9.            SELECT F2 ASSIGN TO DISK
  10.            ORGANIZATION IS SEQUENTIAL
  11.            ACCESS MODE IS SEQUENTIAL.
  12.            SELECT WF ASSIGN TO DISK
  13.            ORGANIZATION IS SEQUENTIAL
  14.            ACCESS MODE IS SEQUENTIAL.
  15.        DATA DIVISION.
  16.        FILE SECTION.
  17.        FD F1
  18.            VALUE OF FILE-ID IS "SORT2.TXT"
  19.            LABEL RECORDS ARE STANDARD.
  20.        01 REC1.
  21.           02 ROLL PIC X(2).
  22.           02 NAME PIC X(10).
  23.           02 DEPT PIC X(10).
  24.           02 MARKS PIC 9(4).
  25.        FD F2
  26.            VALUE OF FILE-ID IS "SORT3.TXT"
  27.            LABEL RECORDS ARE STANDARD.
  28.        01 REC2 PIC X(26).
  29.        SD WF.
  30.        01 REC3.
  31.           02 WROLL PIC X(2).
  32.           02 FILLER PIC X(24).
  33.        PROCEDURE DIVISION.
  34.        MAINPARA.
  35.            OPEN OUTPUT F1.
  36.            PERFORM WRITE-PARA 3 TIMES.
  37.            CLOSE F1.
  38.            SORT WF ON ASCENDING KEY WROLL
  39.             INPUT PROCEDURE IS CHECK GIVING F2.
  40.            OPEN INPUT F2.
  41.        W-PARA.
  42.            READ F2 AT END GO TO EXIT-PARA.
  43.            DISPLAY REC2.
  44.            GO TO W-PARA.
  45.        EXIT-PARA.
  46.            CLOSE F2.        
  47.            STOP RUN.
  48.        WRITE-PARA.
  49.            DISPLAY "ENTER ROLL NO.".
  50.            ACCEPT ROLL.
  51.            DISPLAY "ENTER YOUR NAME".
  52.            ACCEPT NAME.
  53.            DISPLAY "ENTER YOUR DEPT.".
  54.            ACCEPT DEPT.
  55.            DISPLAY "ENTER YOUR MARKS".
  56.            ACCEPT MARKS.
  57.            WRITE REC1.  
  58.        CHECK SECTION.
  59.        OPEN-PARA.
  60.            OPEN INPUT F1.
  61.        READ-PARA.
  62.            READ F1 AT END GO TO DISPLAY-PARA.
  63.            IF ( MARKS > 60 )
  64.              MOVE REC1 TO REC3
  65.              RELEASE REC3.
  66.              GO TO READ-PARA.
  67.        DISPLAY-PARA.
  68.            CLOSE F1.
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×