SlideShare a Scribd company logo
COBOL Basics 2
Group Items/Records H E N N E S S Y R M 9 2 3 0 1 6 5 L M 5 1 0 5 5 0 F StudentDetails WORKING-STORAGE SECTION. 01 StudentDetails PIC X(26).
Group Items/Records H  E N  N  E  S  S  Y  R M  9  2  3  0  1  6  5  L  M  5  1  0  5  5  0  F StudentDetails StudentName StudentId CourseCode Grant  Gender WORKING-STORAGE SECTION. 01 StudentDetails. 02 StudentName PIC X(10). 02 StudentId PIC 9(7). 02 CourseCode PIC X(4). 02 Grant PIC 9(4). 02 Gender PIC X.
Group Items/Records H  E N  N  E  S  S  Y  R M  9  2  3  0  1  6  5  L  M  5  1  0  5  5  0  F StudentDetails Surname Initials WORKING-STORAGE SECTION. 01 StudentDetails. 02 StudentName. 03 Surname PIC X(8). 03 Initials PIC XX. 02 StudentId PIC 9(7). 02 CourseCode PIC X(4). 02 Grant PIC 9(4). 02 Gender PIC X. StudentName StudentId CourseCode Grant  Gender
LEVEL Numbers express DATA hierarchy ,[object Object],[object Object],[object Object],[object Object]
LEVEL Numbers express DATA hierarchy ,[object Object],[object Object],[object Object],[object Object],01 StudentDetails. 02 StudentName. 03 Surname PIC X(8). 03 Initials PIC XX. 02 StudentId PIC 9(7). 02 CourseCode PIC X(4). 02 Grant PIC 9(4). 02 Gender PIC X. 01 StudentDetails. 05 StudentName. 10 Surname PIC X(8). 10 Initials PIC XX. 05 StudentId PIC 9(7). 05 CourseCode PIC X(4). 05 Grant PIC 9(4). 05 Gender PIC X. =
Group and elementary items. ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
PICTUREs for Group Items ,[object Object],[object Object],[object Object]
Assignment in COBOL ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
The MOVE Verb ,[object Object],[object Object],[object Object],[object Object]
MOVEing Data ,[object Object],MOVE “RYAN” TO Surname. MOVE “FITZPATRICK” TO Surname. 01 Surname PIC X(8).
[object Object],MOVEing Data MOVE “RYAN” TO Surname. MOVE “FITZPATRICK” TO Surname. 01 Surname PIC X(8).
MOVEing Data ,[object Object],MOVE “RYAN” TO Surname. MOVE “FITZPATRICK” TO Surname. 01 Surname PIC X(8).
MOVEing to a numeric item. ,[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],MOVE ZEROS TO GrossPay. MOVE 12.4 TO GrossPay. MOVE 123.456 TO GrossPay. MOVE 12345.757 TO GrossPay. 01 GrossPay PIC 9(4)V99.         GrossPay GrossPay GrossPay GrossPay
[object Object],[object Object],[object Object],[object Object],MOVE 1234 TO CountyPop. MOVE 12.4 TO CountyPop. MOVE 154 TO Price. MOVE 3552.75 TO Price. 01 CountyPop PIC 999. 01 Price PIC 999V99.       Price CountyPop     CountyPop Price
Legal MOVEs ,[object Object]
The DISPLAY Verb ,[object Object],[object Object],[object Object],[object Object]
The ACCEPT verb ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
PROCEDURE DIVISION. Begin. DISPLAY "Enter student details using template below". DISPLAY "NNNNNNNNNNSSSSSSSCCCCGGGGS  ". ACCEPT  StudentDetails. ACCEPT  CurrentDate FROM DATE. ACCEPT  DayOfYear FROM DAY. ACCEPT  CurrentTime FROM TIME. DISPLAY "Name is ", Initials SPACE Surname. DISPLAY "Date is " CurrentDay SPACE CurrentMonth SPACE CurrentYear. DISPLAY "Today is day " YearDay " of the year". DISPLAY "The time is " CurrentHour ":" CurrentMinute. STOP RUN. $ SET SOURCEFORMAT"FREE" IDENTIFICATION DIVISION. PROGRAM-ID.  AcceptAndDisplay. AUTHOR.  Michael Coughlan. DATA DIVISION. WORKING-STORAGE SECTION. 01 StudentDetails. 02  StudentName. 03 Surname  PIC X(8). 03 Initials  PIC XX. 02  StudentId  PIC 9(7). 02  CourseCode  PIC X(4). 02  Grant  PIC 9(4). 02  Gender  PIC X. 01 CurrentDate. 02  CurrentYear  PIC 99. 02  CurrentMonth  PIC 99. 02  CurrentDay  PIC 99. 01 DayOfYear. 02  FILLER  PIC 99. 02  YearDay  PIC 9(3). 01 CurrentTime. 02  CurrentHour  PIC 99. 02  CurrentMinute  PIC 99. 02  FILLER  PIC 9(4). Enter student details using template below NNNNNNNNNNSSSSSSSCCCCGGGGS COUGHLANMS9476532LM511245M Name is MS COUGHLAN Date is 24 01 94 Today is day 024 of the year The time is 22:23 Run of Accept and Display program

More Related Content

What's hot

Back patching
Back patchingBack patching
Back patching
santhiya thavanthi
 
Evaluation of postfix expression
Evaluation of postfix expressionEvaluation of postfix expression
Evaluation of postfix expression
Akhil Ahuja
 
Assignment6
Assignment6Assignment6
Assignment6
Sunita Milind Dol
 
Intermediate code generator
Intermediate code generatorIntermediate code generator
Intermediate code generator
sanchi29
 
Compiler Design - Ambiguous grammar, LMD & RMD, Infix & Postfix, Implementati...
Compiler Design - Ambiguous grammar, LMD & RMD, Infix & Postfix, Implementati...Compiler Design - Ambiguous grammar, LMD & RMD, Infix & Postfix, Implementati...
Compiler Design - Ambiguous grammar, LMD & RMD, Infix & Postfix, Implementati...
Saikrishna Tanguturu
 
358 33 powerpoint-slides_9-stacks-queues_chapter-9
358 33 powerpoint-slides_9-stacks-queues_chapter-9358 33 powerpoint-slides_9-stacks-queues_chapter-9
358 33 powerpoint-slides_9-stacks-queues_chapter-9
sumitbardhan
 
Introduction to c programming
Introduction to c programmingIntroduction to c programming
Introduction to c programming
Infinity Tech Solutions
 
Intermediate code generation (Compiler Design)
Intermediate code generation (Compiler Design)   Intermediate code generation (Compiler Design)
Intermediate code generation (Compiler Design)
Tasif Tanzim
 
Chapter 6 Intermediate Code Generation
Chapter 6   Intermediate Code GenerationChapter 6   Intermediate Code Generation
Chapter 6 Intermediate Code Generation
Radhakrishnan Chinnusamy
 
Compiler Design QA
Compiler Design QACompiler Design QA
Compiler Design QA
Dr. C.V. Suresh Babu
 
VTU 1ST SEM PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPERS OF JUNE-2015 & ...
VTU 1ST SEM  PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPERS OF JUNE-2015 & ...VTU 1ST SEM  PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPERS OF JUNE-2015 & ...
VTU 1ST SEM PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPERS OF JUNE-2015 & ...
vtunotesbysree
 
Chapter 6 ds
Chapter 6 dsChapter 6 ds
Chapter 6 ds
Hanif Durad
 
Syntaxdirected
SyntaxdirectedSyntaxdirected
Chapter 6 intermediate code generation
Chapter 6   intermediate code generationChapter 6   intermediate code generation
Chapter 6 intermediate code generation
Vipul Naik
 
Assignment12
Assignment12Assignment12
Assignment12
Sunita Milind Dol
 
COMPILER DESIGN- Syntax Analysis
COMPILER DESIGN- Syntax AnalysisCOMPILER DESIGN- Syntax Analysis
Module 11
Module 11Module 11
Module 11
bittudavis
 
Intermediate code generation
Intermediate code generationIntermediate code generation
Intermediate code generation
Dr.DHANALAKSHMI SENTHILKUMAR
 
Ch5a
Ch5aCh5a
F# 101
F# 101F# 101
F# 101
Chris Alcock
 

What's hot (20)

Back patching
Back patchingBack patching
Back patching
 
Evaluation of postfix expression
Evaluation of postfix expressionEvaluation of postfix expression
Evaluation of postfix expression
 
Assignment6
Assignment6Assignment6
Assignment6
 
Intermediate code generator
Intermediate code generatorIntermediate code generator
Intermediate code generator
 
Compiler Design - Ambiguous grammar, LMD & RMD, Infix & Postfix, Implementati...
Compiler Design - Ambiguous grammar, LMD & RMD, Infix & Postfix, Implementati...Compiler Design - Ambiguous grammar, LMD & RMD, Infix & Postfix, Implementati...
Compiler Design - Ambiguous grammar, LMD & RMD, Infix & Postfix, Implementati...
 
358 33 powerpoint-slides_9-stacks-queues_chapter-9
358 33 powerpoint-slides_9-stacks-queues_chapter-9358 33 powerpoint-slides_9-stacks-queues_chapter-9
358 33 powerpoint-slides_9-stacks-queues_chapter-9
 
Introduction to c programming
Introduction to c programmingIntroduction to c programming
Introduction to c programming
 
Intermediate code generation (Compiler Design)
Intermediate code generation (Compiler Design)   Intermediate code generation (Compiler Design)
Intermediate code generation (Compiler Design)
 
Chapter 6 Intermediate Code Generation
Chapter 6   Intermediate Code GenerationChapter 6   Intermediate Code Generation
Chapter 6 Intermediate Code Generation
 
Compiler Design QA
Compiler Design QACompiler Design QA
Compiler Design QA
 
VTU 1ST SEM PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPERS OF JUNE-2015 & ...
VTU 1ST SEM  PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPERS OF JUNE-2015 & ...VTU 1ST SEM  PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPERS OF JUNE-2015 & ...
VTU 1ST SEM PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPERS OF JUNE-2015 & ...
 
Chapter 6 ds
Chapter 6 dsChapter 6 ds
Chapter 6 ds
 
Syntaxdirected
SyntaxdirectedSyntaxdirected
Syntaxdirected
 
Chapter 6 intermediate code generation
Chapter 6   intermediate code generationChapter 6   intermediate code generation
Chapter 6 intermediate code generation
 
Assignment12
Assignment12Assignment12
Assignment12
 
COMPILER DESIGN- Syntax Analysis
COMPILER DESIGN- Syntax AnalysisCOMPILER DESIGN- Syntax Analysis
COMPILER DESIGN- Syntax Analysis
 
Module 11
Module 11Module 11
Module 11
 
Intermediate code generation
Intermediate code generationIntermediate code generation
Intermediate code generation
 
Ch5a
Ch5aCh5a
Ch5a
 
F# 101
F# 101F# 101
F# 101
 

Similar to Cobolbasics

CIS/336 ilab 1 of 7
CIS/336 ilab 1 of 7CIS/336 ilab 1 of 7
CIS/336 ilab 1 of 7
ashhadiqbal
 
Unraveling The Meaning From COVID-19 Dataset Using Python – A Tutorial for be...
Unraveling The Meaning From COVID-19 Dataset Using Python – A Tutorial for be...Unraveling The Meaning From COVID-19 Dataset Using Python – A Tutorial for be...
Unraveling The Meaning From COVID-19 Dataset Using Python – A Tutorial for be...
Kavika Roy
 
Cis336 i lab 1 of 7
Cis336 i lab 1 of 7Cis336 i lab 1 of 7
Cis336 i lab 1 of 7
helpido9
 
Rpg Pointers And User Space
Rpg Pointers And User SpaceRpg Pointers And User Space
Rpg Pointers And User Space
ramanjosan
 
Old Oracle Versions
Old Oracle VersionsOld Oracle Versions
Old Oracle Versions
Jeffrey Kemp
 
Mainframe refresher-part-1
Mainframe refresher-part-1Mainframe refresher-part-1
Mainframe refresher-part-1
vishwas17
 
Four Languages From Forty Years Ago
Four Languages From Forty Years AgoFour Languages From Forty Years Ago
Four Languages From Forty Years Ago
Scott Wlaschin
 
Cover PageComplete and copy the following to Word for your cover p.docx
Cover PageComplete and copy the following to Word for your cover p.docxCover PageComplete and copy the following to Word for your cover p.docx
Cover PageComplete and copy the following to Word for your cover p.docx
faithxdunce63732
 
Bc0038– data structure using c
Bc0038– data structure using cBc0038– data structure using c
Bc0038– data structure using c
hayerpa
 
databases2
databases2databases2
databases2
c.west
 
11 chapter06 slc_int_float_mov_mvm_fa14
11 chapter06 slc_int_float_mov_mvm_fa1411 chapter06 slc_int_float_mov_mvm_fa14
11 chapter06 slc_int_float_mov_mvm_fa14
John Todora
 
Kudler has plenty of room to increase sales while controlling cost.docx
Kudler has plenty of room to increase sales while controlling cost.docxKudler has plenty of room to increase sales while controlling cost.docx
Kudler has plenty of room to increase sales while controlling cost.docx
DIPESH30
 
ADBMS ASSIGNMENT
ADBMS ASSIGNMENTADBMS ASSIGNMENT
ADBMS ASSIGNMENT
Lori Moore
 
Sql 99 and_some_techniques
Sql 99 and_some_techniquesSql 99 and_some_techniques
Sql 99 and_some_techniques
Alexey Kiselyov
 
Lesson 4 stacks and queues
Lesson 4  stacks and queuesLesson 4  stacks and queues
Lesson 4 stacks and queues
MLG College of Learning, Inc
 
1 Exploratory Data Analysis (EDA) by Melvin Ott, PhD.docx
1 Exploratory Data Analysis (EDA) by Melvin Ott, PhD.docx1 Exploratory Data Analysis (EDA) by Melvin Ott, PhD.docx
1 Exploratory Data Analysis (EDA) by Melvin Ott, PhD.docx
honey725342
 
34slideDatabaseProgramming.ppt
34slideDatabaseProgramming.ppt34slideDatabaseProgramming.ppt
34slideDatabaseProgramming.ppt
MohammedNouh7
 
databases3b
databases3bdatabases3b
databases3b
c.west
 
Database Management System Review
Database Management System ReviewDatabase Management System Review
Database Management System Review
Kaya Ota
 
Learning SAS by Example -A Programmer’s Guide by Ron CodySolution
Learning SAS by Example -A Programmer’s Guide by Ron CodySolutionLearning SAS by Example -A Programmer’s Guide by Ron CodySolution
Learning SAS by Example -A Programmer’s Guide by Ron CodySolution
Vibeesh CS
 

Similar to Cobolbasics (20)

CIS/336 ilab 1 of 7
CIS/336 ilab 1 of 7CIS/336 ilab 1 of 7
CIS/336 ilab 1 of 7
 
Unraveling The Meaning From COVID-19 Dataset Using Python – A Tutorial for be...
Unraveling The Meaning From COVID-19 Dataset Using Python – A Tutorial for be...Unraveling The Meaning From COVID-19 Dataset Using Python – A Tutorial for be...
Unraveling The Meaning From COVID-19 Dataset Using Python – A Tutorial for be...
 
Cis336 i lab 1 of 7
Cis336 i lab 1 of 7Cis336 i lab 1 of 7
Cis336 i lab 1 of 7
 
Rpg Pointers And User Space
Rpg Pointers And User SpaceRpg Pointers And User Space
Rpg Pointers And User Space
 
Old Oracle Versions
Old Oracle VersionsOld Oracle Versions
Old Oracle Versions
 
Mainframe refresher-part-1
Mainframe refresher-part-1Mainframe refresher-part-1
Mainframe refresher-part-1
 
Four Languages From Forty Years Ago
Four Languages From Forty Years AgoFour Languages From Forty Years Ago
Four Languages From Forty Years Ago
 
Cover PageComplete and copy the following to Word for your cover p.docx
Cover PageComplete and copy the following to Word for your cover p.docxCover PageComplete and copy the following to Word for your cover p.docx
Cover PageComplete and copy the following to Word for your cover p.docx
 
Bc0038– data structure using c
Bc0038– data structure using cBc0038– data structure using c
Bc0038– data structure using c
 
databases2
databases2databases2
databases2
 
11 chapter06 slc_int_float_mov_mvm_fa14
11 chapter06 slc_int_float_mov_mvm_fa1411 chapter06 slc_int_float_mov_mvm_fa14
11 chapter06 slc_int_float_mov_mvm_fa14
 
Kudler has plenty of room to increase sales while controlling cost.docx
Kudler has plenty of room to increase sales while controlling cost.docxKudler has plenty of room to increase sales while controlling cost.docx
Kudler has plenty of room to increase sales while controlling cost.docx
 
ADBMS ASSIGNMENT
ADBMS ASSIGNMENTADBMS ASSIGNMENT
ADBMS ASSIGNMENT
 
Sql 99 and_some_techniques
Sql 99 and_some_techniquesSql 99 and_some_techniques
Sql 99 and_some_techniques
 
Lesson 4 stacks and queues
Lesson 4  stacks and queuesLesson 4  stacks and queues
Lesson 4 stacks and queues
 
1 Exploratory Data Analysis (EDA) by Melvin Ott, PhD.docx
1 Exploratory Data Analysis (EDA) by Melvin Ott, PhD.docx1 Exploratory Data Analysis (EDA) by Melvin Ott, PhD.docx
1 Exploratory Data Analysis (EDA) by Melvin Ott, PhD.docx
 
34slideDatabaseProgramming.ppt
34slideDatabaseProgramming.ppt34slideDatabaseProgramming.ppt
34slideDatabaseProgramming.ppt
 
databases3b
databases3bdatabases3b
databases3b
 
Database Management System Review
Database Management System ReviewDatabase Management System Review
Database Management System Review
 
Learning SAS by Example -A Programmer’s Guide by Ron CodySolution
Learning SAS by Example -A Programmer’s Guide by Ron CodySolutionLearning SAS by Example -A Programmer’s Guide by Ron CodySolution
Learning SAS by Example -A Programmer’s Guide by Ron CodySolution
 

More from shivas

Mainframe
MainframeMainframe
Mainframe
shivas
 
Jcl tutor
Jcl tutorJcl tutor
Jcl tutor
shivas
 
Jcl
JclJcl
Jcl
shivas
 
Premmanispecification
PremmanispecificationPremmanispecification
Premmanispecification
shivas
 
Premmani
PremmaniPremmani
Premmani
shivas
 
Premamaniscreenshots
PremamaniscreenshotsPremamaniscreenshots
Premamaniscreenshots
shivas
 
Wordpress
WordpressWordpress
Wordpress
shivas
 
Ajax Basics And Framework
Ajax Basics And FrameworkAjax Basics And Framework
Ajax Basics And Framework
shivas
 
Phpbasics And Php Framework
Phpbasics And Php FrameworkPhpbasics And Php Framework
Phpbasics And Php Framework
shivas
 
Frame Work
Frame WorkFrame Work
Frame Work
shivas
 
Frame
FrameFrame
Frame
shivas
 
Web2.O Basics
Web2.O BasicsWeb2.O Basics
Web2.O Basics
shivas
 

More from shivas (12)

Mainframe
MainframeMainframe
Mainframe
 
Jcl tutor
Jcl tutorJcl tutor
Jcl tutor
 
Jcl
JclJcl
Jcl
 
Premmanispecification
PremmanispecificationPremmanispecification
Premmanispecification
 
Premmani
PremmaniPremmani
Premmani
 
Premamaniscreenshots
PremamaniscreenshotsPremamaniscreenshots
Premamaniscreenshots
 
Wordpress
WordpressWordpress
Wordpress
 
Ajax Basics And Framework
Ajax Basics And FrameworkAjax Basics And Framework
Ajax Basics And Framework
 
Phpbasics And Php Framework
Phpbasics And Php FrameworkPhpbasics And Php Framework
Phpbasics And Php Framework
 
Frame Work
Frame WorkFrame Work
Frame Work
 
Frame
FrameFrame
Frame
 
Web2.O Basics
Web2.O BasicsWeb2.O Basics
Web2.O Basics
 

Cobolbasics

  • 2. Group Items/Records H E N N E S S Y R M 9 2 3 0 1 6 5 L M 5 1 0 5 5 0 F StudentDetails WORKING-STORAGE SECTION. 01 StudentDetails PIC X(26).
  • 3. Group Items/Records H E N N E S S Y R M 9 2 3 0 1 6 5 L M 5 1 0 5 5 0 F StudentDetails StudentName StudentId CourseCode Grant Gender WORKING-STORAGE SECTION. 01 StudentDetails. 02 StudentName PIC X(10). 02 StudentId PIC 9(7). 02 CourseCode PIC X(4). 02 Grant PIC 9(4). 02 Gender PIC X.
  • 4. Group Items/Records H E N N E S S Y R M 9 2 3 0 1 6 5 L M 5 1 0 5 5 0 F StudentDetails Surname Initials WORKING-STORAGE SECTION. 01 StudentDetails. 02 StudentName. 03 Surname PIC X(8). 03 Initials PIC XX. 02 StudentId PIC 9(7). 02 CourseCode PIC X(4). 02 Grant PIC 9(4). 02 Gender PIC X. StudentName StudentId CourseCode Grant Gender
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20. PROCEDURE DIVISION. Begin. DISPLAY "Enter student details using template below". DISPLAY "NNNNNNNNNNSSSSSSSCCCCGGGGS ". ACCEPT StudentDetails. ACCEPT CurrentDate FROM DATE. ACCEPT DayOfYear FROM DAY. ACCEPT CurrentTime FROM TIME. DISPLAY "Name is ", Initials SPACE Surname. DISPLAY "Date is " CurrentDay SPACE CurrentMonth SPACE CurrentYear. DISPLAY "Today is day " YearDay " of the year". DISPLAY "The time is " CurrentHour ":" CurrentMinute. STOP RUN. $ SET SOURCEFORMAT"FREE" IDENTIFICATION DIVISION. PROGRAM-ID. AcceptAndDisplay. AUTHOR. Michael Coughlan. DATA DIVISION. WORKING-STORAGE SECTION. 01 StudentDetails. 02 StudentName. 03 Surname PIC X(8). 03 Initials PIC XX. 02 StudentId PIC 9(7). 02 CourseCode PIC X(4). 02 Grant PIC 9(4). 02 Gender PIC X. 01 CurrentDate. 02 CurrentYear PIC 99. 02 CurrentMonth PIC 99. 02 CurrentDay PIC 99. 01 DayOfYear. 02 FILLER PIC 99. 02 YearDay PIC 9(3). 01 CurrentTime. 02 CurrentHour PIC 99. 02 CurrentMinute PIC 99. 02 FILLER PIC 9(4). Enter student details using template below NNNNNNNNNNSSSSSSSCCCCGGGGS COUGHLANMS9476532LM511245M Name is MS COUGHLAN Date is 24 01 94 Today is day 024 of the year The time is 22:23 Run of Accept and Display program