Upload
ravikiran8p
View
218
Download
0
Embed Size (px)
Citation preview
7/27/2019 COBOL_Training_Class-11.ppsx
http://slidepdf.com/reader/full/coboltrainingclass-11ppsx 1/19
IBM Mainframes
COBOL Training Class-12
7/27/2019 COBOL_Training_Class-11.ppsx
http://slidepdf.com/reader/full/coboltrainingclass-11ppsx 2/19
DataSets
Dataset: A named collection of data in an IBM
mainframe operating system. A data set in an IBM
mainframe is the equivalent of a file in other
operating systems
A dataset is typically stored on Direct Access Storage
Disk (DASD or magnetic tape .
!hese Dataset are of t"o types: #DS (#artitioned Dataset
#S (#hysical Sequential Dataset
7/27/2019 COBOL_Training_Class-11.ppsx
http://slidepdf.com/reader/full/coboltrainingclass-11ppsx 3/19
Partitioned Data Set & Physical Sequential Dataset
PDS or Partitioned Data Set is a dataset containing multiple partition$s
each of "hich may contain a members
Members are %&B&' #rograms )%' #rograms 'oad Modules etc.
!he #artitioned Data Set can only allocate on a single volume "ith the
ma*imum si+e of ,--, tracks.
PS or Physical Sequential Data Set is a dataset that contains records
Records like employee details customer details etc.
7/27/2019 COBOL_Training_Class-11.ppsx
http://slidepdf.com/reader/full/coboltrainingclass-11ppsx 4/19
DASD & Main-Memory
Direct Access Storage Disk ( DASD ) Mainframes /ard Disk
"hich stores the physical data
DASD
UNITS ( SYSDA & SYSADA)
!"U#$S
DATA S$TS #$#%$RSR$'"RDS
#ain#eory :
Mainframes temporary space used 0y varia0les of an
application program.
7/27/2019 COBOL_Training_Class-11.ppsx
http://slidepdf.com/reader/full/coboltrainingclass-11ppsx 5/19
Steps to follow
*+ Allocation: !he files used in the program should 0e declared1specified in
2I'34%&5!6&' paragraph "ith4in I5#7!4&7!#7! S3%!I&5 of
358I6&53M5! DI8ISI&5.
,+ De-inition. !he 6ecord layout of the file and its attri0utes are defined in
the 2D #A6A96A#/ "ith4in 2I'3 S3%!I&5 of DA!A DI8ISI&5..+ "/en: Dataset is connected1readied to your program using #
statement. !he mode of # decides the operation allo"ed and the
initial pointer in the dataset.
0+ Process: #rocess the file as per requirement using the I4& statements
12I'3 836BS provided 0y %&B&'. (63AD 6I!3 636I!3 and
D3'3!3
1+ 'lose: After the processing close the file to disconnect it from the
program.
7/27/2019 COBOL_Training_Class-11.ppsx
http://slidepdf.com/reader/full/coboltrainingclass-11ppsx 6/19
Enironment !iision
Define the file in 2I'34%&5!6&' #aragraph of I5#7!4&7!#7!
S3%!I&5 "ith in 358I6&5M35! DI8ISI&5.
S$$'T Statement is used to define a file.
358I6&5M35! DI8ISI&5. I5#7!4&7!#7! S3%!I&5.
2I'34%&5!6&'.
S3'3%! "2I'A3I$NA#$ ASSI95 !& DD5AM3
&69A5I;A!I&5 IS S3<735!IA'
A%%3SS M&D3 IS S3<735!IA'2I'3 S!A!7S IS S4S!A!7S.
&rgani+ation and Access mode is optional for a #S file the default is
sequential itself
7/27/2019 COBOL_Training_Class-11.ppsx
http://slidepdf.com/reader/full/coboltrainingclass-11ppsx 7/19
"oints To #ote
Nu4er o- S$$'T statements specifies num0er of files
used in a program.
'ogical file name is used through out the program e*ecution.
Must not e*ceed = characters.
'ike 3M#2I'3 %7S!2I'3 I542I'3 &7!2I'3 etc.
DD5AM3 Acts as a link 0et"een logical and physical file
name "hich is used in the e*ecution )%'.
Must 5ot 3*ceed = %haracters.
'ike 3M#DD %7S!DD I54DD &7!4DD 3!%.
7/27/2019 COBOL_Training_Class-11.ppsx
http://slidepdf.com/reader/full/coboltrainingclass-11ppsx 8/19
Organi$ation an! A%%ess Mo!e
"rgani5ation : !he "ay in "hich records are arranged in the file.
6ays o- organi5ation 7
Sequential &ne record after other
Inde8ed Based on a inde* key value ( 8SAM
Relati9e Based on a relative record num0er ( 8SAM
Access ode : !he "ay in "hich records can 0e accessed ( 63!I63D
from a file.
Access ode are 7
Sequential &ne after other record only till end of the file
Rando Access directly a record from the file
Dynaic Both direct and sequential com0ined
7/27/2019 COBOL_Training_Class-11.ppsx
http://slidepdf.com/reader/full/coboltrainingclass-11ppsx 9/19
ile Stat's Co!e
It is a t:o4yte "orking storage item. !he first 0yte denotes the
general category "hereas second 0yte denotes the particular type of
error message under that category.
0 Successful OPEN/READ/WRITE Operation
>> Successful completion
10 When AT END conition fails ?> Sequential 63AD is attempted
a-ter the end o- -ile is reached
@> >
@? @@ @ @C > @ all these are related to 8SAM.
> &pening 3rror 'ike.. mostly
C> 'ogical 3rror in programs
7/27/2019 COBOL_Training_Class-11.ppsx
http://slidepdf.com/reader/full/coboltrainingclass-11ppsx 10/19
DATA DI(ISIO#
2ile has to 0e descri0ed in 2D #aragraph of 2I'3 S3%!I&5 "ith in
DA!A DI8ISI&5.
2ile section should 0e the first section if coded.
Synta*:
DA!A DI8ISI&5.
2I'3 S3%!I&5.
2D '&9I%A'42I'35AM3
'AB3' 63%&6DS A63 S!A5DA6D1&MMI!3D.
>? 63%&6D4'AE&7!.>- F.. 1 %&#E %&#EB&&G45AM3.
Instead of record layout specifying here "e mostly use %&#EB&&G .
7/27/2019 COBOL_Training_Class-11.ppsx
http://slidepdf.com/reader/full/coboltrainingclass-11ppsx 11/19
Open an! Close
Any file operated in an application program need to 0e opened
first and later on closed after the task completion .
Synta* :
# #I594M&D3 2I'3?H2I'3@.
%'&S3 2I'3?H2I'3@.
7/27/2019 COBOL_Training_Class-11.ppsx
http://slidepdf.com/reader/full/coboltrainingclass-11ppsx 12/19
ile Opening mo!es
e have C type of opening modes.
!hey are :
INPUT Mode :4 %an perform only read
"ut/ut Mode :4 %an perform only "rite
I" Mode :4 %an perform read and re"rite
$8tend Mode:4 %an append a ne" record to e*isting file
7/27/2019 COBOL_Training_Class-11.ppsx
http://slidepdf.com/reader/full/coboltrainingclass-11ppsx 13/19
ile Operation & ile (er)s
!o perform any operation on file "e use one file ver0 "hich are listed 0elo"
3ile 9er4 Action "/ening ode
# %onnect to file 444
%'&S3 6elease the file 444
63AD 6etrieves a record I5#7!
6I!3 Adds a ne" record &7!#7!
636I!3 7pdate an e*isting record I4&
D3'3!3 Delete$s a record I4&
7/27/2019 COBOL_Training_Class-11.ppsx
http://slidepdf.com/reader/full/coboltrainingclass-11ppsx 14/19
*EAD (er)
63AD ver0 reads a single record at a time. 6ecord fetch 0y read statement
"ill 0e moved into the record layout defined at 2D "ithin 2I'34
S3%!I&5. 2ile must 0e opened in I5#7! 1 I4& Mode
Synta* ?. !o read only one record
63AD 3I$NA#$ HI5!& S463%&6D4'AE&7!
Synta* @. !o read till end of the file sequentially
63AD 3I$NA#$
A! 35D
S!A!3M35! 5&! A! 35D
S!A!3M35!
35D463AD.
7/27/2019 COBOL_Training_Class-11.ppsx
http://slidepdf.com/reader/full/coboltrainingclass-11ppsx 15/19
+*ITE (er)
6RIT$ 836B is used to "rite a ne" record into the file. 2ile must
0e opened in "UTPUT Mode.
!he data has to 0e moved into the record layout 0efore making a "rite
statement.
Synta* :
6I!3 63%&6D4'AE&7!.
63%&6D 'AE&7! defined in 2I'34S3%!I&5 along "ith 2D
6I!3 63%&6D4'AE&7! 26&M S496&7#45AM3.
S &6GI594S!&6A93 S3%!I&5 data4area
7/27/2019 COBOL_Training_Class-11.ppsx
http://slidepdf.com/reader/full/coboltrainingclass-11ppsx 16/19
*E+*ITE (er)
636I!3 836B updates a specific record "hich is already e*ists
in the file. 2ile must 0e opened in I" Mode.
!he updated data has to 0e moved into the record layout 0efore
making a re"rite statement.
Synta* :
R$6RIT$ 63%&6D4'AE&7!.
7/27/2019 COBOL_Training_Class-11.ppsx
http://slidepdf.com/reader/full/coboltrainingclass-11ppsx 17/19
DELETE (er)
Delete ver0 delete;s a record from the file.
6ecord present in #S 2I'3 cannot 4e deleted instead "e move space
to remove a record from the file.
Synta* :
D$$T$ 2I'35AM3.
Deletes only one record not the file.
7/27/2019 COBOL_Training_Class-11.ppsx
http://slidepdf.com/reader/full/coboltrainingclass-11ppsx 18/19
Sample "rograms
In Practical
7/27/2019 COBOL_Training_Class-11.ppsx
http://slidepdf.com/reader/full/coboltrainingclass-11ppsx 19/19
T,an .o'