ADVERTISEMENT
Sunday, January 24, 2021
  • PRESS RELEASE
  • ADVERTISE
  • CONTACT
No Result
View All Result
Tech News, Magazine & Review WordPress Theme 2017
  • Home
  • Technology

    Apple AirPods Pro return to $199 this weekend at Amazon

    Awful parking is the worst thing about escooters — TIER has a plan to fix it

    Vicarious Visions, developer of Tony Hawk 1+2, has joined Blizzard Entertainment

    Microsoft blasts Apple’s MacBook Pro in new Surface Pro 7 ad

    Best Gaming Mouse (2021): Wireless, Corded, and Under $50

    We could know soon whether vaccines work against a scary new coronavirus variant

  • Science

    Eight Forests And 220,000 Acres

    George Carruthers, Whose Telescopes Explored Space, Dies at 81

    SpaceX delays launch of 143 satellites on a single rocket due to bad weather

    A New Project Maps the Pacific Coast’s Critical Kelp Forests

    Climate impact on childhood diet may undermine food security efforts

    Filing Suit for ‘Wrongful Life’

  • Medical/Pharmacology

    Study proves potential for reducing pre-term birth by treating fetus as patient

    New maintenance treatment for AML shows strong benefit for patients

    Lifestyle Fallout From Hip Fracture Declines by Year 2

    MS: Finding Your Support Community

    Trump’s pardons included healthcare execs behind massive frauds

    Cognate beefs up cell, gene therapy manufacturing with new plants in U.S., EU

    Trending Tags

    • Playstation 4 Pro
    • iOS 10
    • iPhone 7
    • Sillicon Valley
  • Cloud Computing

    Investing in the Gaming Industry

    New Book Showcases Bermuda’s Offering for Private Trust Companies

    5 PaaS security best practices to safeguard the application layer

    Five tips for observability success amid cloud complexity

    Automation processes in workforces for SMEs

    Big changes are coming for 5G edge computing

  • Data Center

    Optus partners with Google Cloud to improve customer support capabilities

    Top 5 Data Center Stories of the Week: January 22, 2021

    American Real Estate Acquires Site in Ashburn’s Data Center Alley

    Preempting Regulation, EU Operators Strike Green Data Center Pact

    Asian cloud providers maintain strong reputation in the region

    TeleGeography releases data center benchmark tool

  • Software Development

    Fibonacci Series in C++ – Tutorial And Example

    30 Days to Form a New Habit of Coding – Are You In?

    I Almost Got Fired for Choosing React in Our Enterprise App : programming

    Microsoft makes Win32 APIs available to more languages

    Why Self-Taught Programmers Should Not Have a Minority Complex | by Yulia Lukashina | Better Programming | Jan, 2021

    How much does a web design cost?

  • The Quotes Of The Day
  • Home
  • Technology

    Apple AirPods Pro return to $199 this weekend at Amazon

    Awful parking is the worst thing about escooters — TIER has a plan to fix it

    Vicarious Visions, developer of Tony Hawk 1+2, has joined Blizzard Entertainment

    Microsoft blasts Apple’s MacBook Pro in new Surface Pro 7 ad

    Best Gaming Mouse (2021): Wireless, Corded, and Under $50

    We could know soon whether vaccines work against a scary new coronavirus variant

  • Science

    Eight Forests And 220,000 Acres

    George Carruthers, Whose Telescopes Explored Space, Dies at 81

    SpaceX delays launch of 143 satellites on a single rocket due to bad weather

    A New Project Maps the Pacific Coast’s Critical Kelp Forests

    Climate impact on childhood diet may undermine food security efforts

    Filing Suit for ‘Wrongful Life’

  • Medical/Pharmacology

    Study proves potential for reducing pre-term birth by treating fetus as patient

    New maintenance treatment for AML shows strong benefit for patients

    Lifestyle Fallout From Hip Fracture Declines by Year 2

    MS: Finding Your Support Community

    Trump’s pardons included healthcare execs behind massive frauds

    Cognate beefs up cell, gene therapy manufacturing with new plants in U.S., EU

    Trending Tags

    • Playstation 4 Pro
    • iOS 10
    • iPhone 7
    • Sillicon Valley
  • Cloud Computing

    Investing in the Gaming Industry

    New Book Showcases Bermuda’s Offering for Private Trust Companies

    5 PaaS security best practices to safeguard the application layer

    Five tips for observability success amid cloud complexity

    Automation processes in workforces for SMEs

    Big changes are coming for 5G edge computing

  • Data Center

    Optus partners with Google Cloud to improve customer support capabilities

    Top 5 Data Center Stories of the Week: January 22, 2021

    American Real Estate Acquires Site in Ashburn’s Data Center Alley

    Preempting Regulation, EU Operators Strike Green Data Center Pact

    Asian cloud providers maintain strong reputation in the region

    TeleGeography releases data center benchmark tool

  • Software Development

    Fibonacci Series in C++ – Tutorial And Example

    30 Days to Form a New Habit of Coding – Are You In?

    I Almost Got Fired for Choosing React in Our Enterprise App : programming

    Microsoft makes Win32 APIs available to more languages

    Why Self-Taught Programmers Should Not Have a Minority Complex | by Yulia Lukashina | Better Programming | Jan, 2021

    How much does a web design cost?

  • The Quotes Of The Day
Infinity CS News
No Result
View All Result

COBOL Indexed File – Tutorial And Example

Superuser by Superuser
January 10, 2021
Home Software Development
Share on FacebookShare on Twitter


What are Listed Information?

  • The listed information are these information through which the group is all the time listed, and the entry is finished utilizing key values.
  • These information use alphanumeric characters as the important thing, and the important thing should be uniquely outlined.
  • The information in listed information may be accessed a lot sooner, and in any order regardless of place utilizing the important thing.
  • The entry mode to entry any file may be sequential in addition to random.

Understanding Index file dealing with in COBOL

SYNTAX =>

FORMAT 1)

 

SELECT Logical – fl ASSIGNED TO bodily – fl

ORGANIZATION IS INDEXED

ACCESS MODE IS SEQUENTIAL

RECORD KEY IS I – KEY

ALTERNATIVE KEY IS IA – KEY

 

FORMAT 2)

 

SELECT Logical – fl ASSIGNED TO bodily – fl

ORGANIZATION IS INDEXED

ACCESS MODE IS DYNAMIC

RECORD KEY IS I – KEY

ALTERNATIVE KEY IS IA – KEY

 

FORMAT 3)

 

SELECT Logical – fl ASSIGNED TO bodily – fl

ORGANIZATION IS INDEXED

ACCESS MODE IS RANDOM

RECORD KEY IS R – KEY

R – KEY should be outlined in FD clause in the FILE SECTION.

 

Pattern program -1

This can be a demo program to study and perceive the idea of listed file dealing with and assign values from a unique subprogram.

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

 

IDENTIFICATION DIVISION.

PROGRAM–ID. INDEXEDFILE.

ENVIRONMENT DIVISION.

INPUT–OUTPUT SECTION.

FILE–CONTROL.

     SELECT INFL ASSIGN TO INFLDD

     ORGANIZATION IS INDEXED

     ACCESS MODE IS RANDOM

     RECORD KEY IS EMP–ID

     FILE STATUS FS–INFL.

DATA DIVISION.

FILE SECTION.

FD INFL.

01 INFL–REC.

   05 EMP–ID PIC X(05).

   05 FILLER PIC X(01).

   05 EMP–NAME PIC X(19).

   05 REM–BYTE PIC X(55).

WORKING–STORAGE SECTION.

01 FS–INFL PIC X(02) VALUE SPACES.

   88 FS–INFL–OK VALUE ’00’.

   88 FS–INFL–DUP–KEY VALUE ’02’.

   88 FS–INFL–EOF VALUE ’10’.

PROCEDURE DIVISION.

MAIN–PARA.

     PERFORM OPEN–PARA THRU OPEN–EXIT–PARA.

     PERFORM PROCESS–PARA THRU PROCESS–EXIT–PARA.

     PERFORM CLOSE–PARA THRU CLOSE–EXIT–PARA.

     STOP RUN.

OPEN–PARA.

     INITIALIZE FS–INFL INFL–REC.

     OPEN INPUT INFL

     IF FS–INFL–OK

        CONTINUE

     ELSE

        DISPLAY “FILE OPEN FAILED: “ FS–INFL

        GO TO EXIT–PARA

     END–IF.

OPEN–EXIT–PARA.

     EXIT.

PROCESS–PARA.

MOVE ‘08792’ TO EMP–ID

    READ INFL

    KEY IS EMP–ID

    INVALID KEY

          DISPLAY ‘INVALID KEY’

    NOT INVALID KEY

          DISPLAY ‘EMP-NAME:’ EMP–NAME

    END–READ

PROCESS–EXIT–PARA.

    EXIT.

CLOSE–PARA.

    CLOSE INFL.

CLOSE–EXIT–PARA.

    EXIT.

EXIT–PARA.

    EXIT PROGRAM.

 

THE OUTPUT WILL BE

 

***RECORDS STORED IN FILE***

08781 JOHN MICHAEL

08792 RICKEY PONTING

08803 M S DHONI

***RESULT***

EMP–NAME: RICKEY PONTING

 

Right here on this program, we now have assigned a number of variables with totally different values and later manipulated the output utilizing totally different knowledge file dealing with properties to make clear the totally different ideas associated to listed information.

SAMPLE PROGRAM -2

This can be a demo program to study and perceive the idea of rewrite and assign values from a unique subprogram.

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

 

IDENTIFICATION DIVISION.

PROGRAM–ID. REWRITEP.

ENVIRONMENT DIVISION.

INPUT–OUTPUT SECTION.

FILE–CONTROL.

    SELECT I–O–FL ASSIGN TO IOFLDD

    ORGANIZATION IS INDEXED

    ACCESS MODE IS RANDOM

    RECORD KEY IS EMP–ID

    FILE STATUS FS–I–O–FL.

DATA DIVISION.

FILE SECTION.

FD I–O–FL.

01 I–O–FL–REC.

   05 EMP–ID PIC X(05).

   05 FILLER PIC X(01).

   05 EMP–NAME PIC X(19).

   05 REM–BYTE PIC X(55).

WORKING–STORAGE SECTION.

01 FS–I–O–FFL PIC X(02) VALUE SPACES.

PROCEDURE DIVISION.

MAIN–PARA.

    PERFORM OPEN–PARA THRU OPEN–EXIT–PARA.

    PERFORM PROCESS–PARA THRU PROCESS–EXIT–PARA.

    PERFORM CLOSE–PARA THRU CLOSE–EXIT–PARA.

STOP RUN.

OPEN–PARA.

     INITIALIZE FS–I–O–FL I–O–FL–REC.

     OPEN I–O I–O–FL

     IF FS–I–O–FL–OK

        CONTINUE

     ELSE

        DISPLAY “FILE OPEN FAILED: “ FS–I–O–FL

        GO TO EXIT–PARA

     END–IF.

OPEN–EXIT–PARA.

     EXIT.

PROCESS–PARA.

MOVE ‘08792’ TO EMP–ID

    READ I–O–FL

    KEY IS EMP–ID

    INVALID KEY

          DISPLAY ‘INVALID KEY’

    NOT INVALID KEY

          DISPLAY ‘EMP-NAME:’ EMP–NAME

    END–READ

    MOVE ‘ROGER FREDRER’ TO EMP–NAME

    REWRITE I–O–FL–REC.

PROCESS–EXIT–PARA.

    EXIT.

CLOSE–PARA.

    CLOSE INFL.

CLOSE–EXIT–PARA.

    EXIT.

EXIT–PARA.

    EXIT PROGRAM.

 

THE OUTPUT WILL BE

 

***RECORDS STORED IN FILE***

08781 JOHN MICHAEL

08792 RICKEY PONTING

08803 M S DHONI

08814 ROGER FREDRER

***RESULT***

EMP–NAME BEFORE: DUMMY NAME

EMP–NAME AFTER: ROJER FREDRER

 

Right here on this program, we now have assigned a number of variables with totally different values and later manipulated the output utilizing totally different knowledge file dealing with properties to make clear the totally different ideas associated to REWRITE property of information.

Cobol Indexed File
Cobol Indexed File

—————————————————————————————————————-

SAMPLE PROGRAM -3

This can be a demo program to study and perceive the idea of delete and assign values from totally different subprograms.

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

 

IDENTIFICATION DIVISION.

PROGRAM–ID. REWRITEP.

ENVIRONMENT DIVISION.

INPUT–OUTPUT SECTION.

FILE–CONTROL.

    SELECT I–O–FL ASSIGN TO IOFLDD

    ORGANIZATION IS INDEXED

    ACCESS MODE IS RANDOM

    RECORD KEY IS EMP–ID

    FILE STATUS FS–I–O–FL.

DATA DIVISION.

FILE SECTION.

FD I–O–FL.

01 I–O–FL–REC.

   05 EMP–ID PIC X(05).

   05 FILLER PIC X(01).

   05 EMP–NAME PIC X(19).

   05 REM–BYTE PIC X(55).

WORKING–STORAGE SECTION.

01 FS–I–O–FFL PIC X(02) VALUE SPACES.

PROCEDURE DIVISION.

MAIN–PARA.

    PERFORM OPEN–PARA THRU OPEN–EXIT–PARA.

    PERFORM PROCESS–PARA THRU PROCESS–EXIT–PARA.

    PERFORM CLOSE–PARA THRU CLOSE–EXIT–PARA.

STOP RUN.

OPEN–PARA.

     INITIALIZE FS–I–O–FL I–O–FL–REC.

     OPEN I–O I–O–FL

     IF FS–I–O–FL–OK

        CONTINUE

     ELSE

        DISPLAY “FILE OPEN FAILED: “ FS–I–O–FL

        GO TO EXIT–PARA

     END–IF.

OPEN–EXIT–PARA.

     EXIT.

PROCESS–PARA.

MOVE ‘08781’ TO EMP–ID

    READ I–O–FL

    KEY IS EMP–ID

    INVALID KEY

          DISPLAY ‘INVALID KEY’

    NOT INVALID KEY

          DISPLAY ‘EMP-NAME:’ EMP–NAME

    END–READ

    MOVE ‘ROGER FREDRER’ TO EMP–NAME

    DELETE I–O–FL RECORD.

    END–DELETE

    DISPLAY ‘ EMP-NAME AFTER: ‘ EMP–NAME.

PROCESS–EXIT–PARA.

    EXIT.

CLOSE–PARA.

    CLOSE INFL.

CLOSE–EXIT–PARA.

    EXIT.

EXIT–PARA.

    EXIT PROGRAM.

 

THE OUTPUT WILL BE

 

***RESULT***

EMP–NAME BEFORE: JOHN MICHAEL

RECORDS DELETED: JOHN MICHAEL

***RECORDS STORED IN FILE***

08792 RICKEY PONTING

08803 M S DHONI

08814 ROGER FREDRER

 

Right here on this program, we now have assigned a number of variables with totally different values and later manipulated the output utilizing totally different knowledge file dealing with properties to make clear the totally different ideas associated to DELETE property of information.

Cobol Indexed File
Cobol Indexed File



Source link

Tags: COBOLFileIndexedTutorial
Superuser

Superuser

Next Post

Juggle a multi-cloud security strategy with these 3 steps

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Infinity CS News

Get the latest news and follow the coverage of Tech updates, science, breakthrough research news and more from the top trusted sources.

Categories

  • Cloud Computing
  • Data Center
  • Medical / Pharmacology
  • Science
  • Software Development
  • Technology
  • The Quotes Of The Day

Recent Posts

  • Eight Forests And 220,000 Acres
  • Apple AirPods Pro return to $199 this weekend at Amazon
  • George Carruthers, Whose Telescopes Explored Space, Dies at 81
  • Home
  • Disclaimer
  • DMCA
  • Privacy Policy
  • Cookie Privacy Policy
  • Terms and Conditions
  • Contact

Copyright © 2021 Infiniti CS News

No Result
View All Result
  • Home
  • Technology
  • Science
  • Medical/Pharmacology
  • Cloud Computing
  • Data Center
  • Software Development
  • The Quotes Of The Day

Copyright © 2021 Infiniti CS News