Bulletin Board

What’s new at MAINFRAMES 360
(Updates)...
- Re-writing of select JCL and VSAM Tutorials is under-way, orientation would be more hands-on, and practical
- New Tutorials on COBOL-VSAM programs shall be put up pretty soon
- IMS DB/DC Tutorials to start up in April, 2010

Mainframes360 Search

Loading

Quick Links

Jump to :  

Saturday, January 16, 2010

Mainframe Information Representation and Storage


Q. How do Mainframe Computers store Data?
On computers, data is stored in the form of bits - 0’s and 1’s(binary). Characters like A,B,C,...,Z are formed with 8 bits called as Bytes. When you press a key on the keyboard, the key emits out eight bits from the cable.

Every key is represented with a unique combination of 0s and 1s. Because, we use 8 bits to store a character, a total of 2^8 = 256 patterns are possible. IBM Mainframe’s designers assigned a unique 8-bit pattern to each character. This scheme of representing characters and data in Mainframe Computers is called Extended Binary Coded Decimal Interchange Code(EBCDIC).
Q. What are Fields, Records, Files and Datasets?
Data such as Customer Name, Customer Address, Phone-numbers are nothing but, just a sequence or group of characters. A group of characters that represent a data-item is called a Field. For example, Customer-name is one field, Customer Address is another such field and so on.

When you group fields like Customer’s name, address and phone-number together, to represent all the information about 1 single customer, it is called a Record. A record can contain of any number of fields. Thus, you can have a record which 100 bytes long, 200 bytes long,..., but records of length 80-byte are common in Mainframes, as in early, input data was fed to Mainframes using Punched Cards which had 80-columns.

When you store a group of records, say 1000 customer records of a Bank, it is called a File. A File is then, just a sequence of records.

IBM Mainframes use the term Dataset instead of File.

Generally, Datasets(Files) are stored on Computer Storage Devices. In Mainframes, there are two popular storage devices – Disk and Tape.


Image81[1]
               
                         INFORMATION STORAGE HIERARCHY
Q. How do you form Dataset Names?
In a Mainframe computer, there would be thousands of files(datasets). It is obvious, to name each Dataset differently. Mainframes support very large dataset names. In Mainframes, a dataset name can be 44 characters long in this format :
XXXXXXXX.XXXXXXXX.XXXXXXXX.XXXXXXXX.XXXXXXXX

You can form a dataset name by taking groups of upto 8 characters. Each of the group must start with a capital letter(alphabet).

Generally, it is a good practice to give meaningful names to your dataset. For example, if you are storing Employees data in a file, you can name it as EMPLOYEE.DATA

The MVS Operating System keeps track of groups of datasets by referring to their names, which are called Qualifiers. The first part of the dataset name is called High-level Qualifier(HLQ).

Generally, when you access or log-in to Mainframes, you are given a USER-ID, just as on Windows PC, you need a userid to login. Most professionals or software engineers who work in Mainframe Projects would have a TSO user-ID. When you use a TSO-id, a special requirement applies to most datasets(files) that belong to you.

Suppose your TSO-id is AGY0157, then all your datasets should have the High-level qualifier AGY0157. Thus, the files that belong to you should start with AGY0157. For example, the name of Employees file would be

AGY0157.EMPLOYEE.DATA

You must understand that, mostly in projects, you can identify the files that belong to you, your application or your system by seeing the High-level Qualifier.

In fact, Mainframes are also installed with Security Software(like RACF), that controls access to files by seeing the High-Level Qualifiers. Thus, although you can see your buddy’s files on a Mainframe, you cannot make any changes to it.
Q. What are Sequential Datasets?
You can think of sequential datasets as a Music cassette, on which music songs are stored one after the other. When you play the cassette, you listen to the music, one song and then the next song and so on.. till you reach the end of the cassette. You cannot directly jump to, or fly to the 5th song, or last song. Thus, a music cassette is accessed sequentially.

On the same lines, records in Sequential files are stored after the other in a series. In a sequential file, you need to read through all the records one by one, step-by-step till you reach the desired record.

Thus, a sequential dataset is the simplest form of dataset. In Mainframes MVS Operating System, sequential dataset is known as PS Dataset, PS stands for Physical Sequential.

Image83[1] 
Q. How do you create a file in ISPF?
ISPF organises most common functionalities that you need to perform on Mainframes – like creating a new file/folder, editing a file, searching for files, taking backup etc. in the form of menus, just like a Nokia Cellular Phone.

To create a new file, you have to go to the menu 3.2 in ISPF. You enter the dataset name here on ISPF Screen.

Image82[1] 
Q. What is a Partitioned Dataset(PDS)?
When you create a sequential dataset(PS), it occupies a large amount of storage space(minimum 50,000 bytes). Sometimes for doing trivial tasks,  storing only a few records, you would not be utilising the entire space available in a sequential file. Thus most of the space in the Sequential file is wasted and is blocked.

IBM provides a way to split or partition up the space in a sequential data-set. IBM Software engineers invented the Partitioned Dataset, often called PDS. Each part is called a Member. A Partitioned Dataset can have many members(parts). Each member behaves like a sequential file on it own.

How does the PDS then keep track of its members? A Partitioned Dataset(PDS) includes a directory(like a telephone directory), which is a diary or journal, where MVS Operating system keeps track of the members in a PDS. The members of a PDS can be scattered haphazardly anywhere in the vast computer storage space. Well-then, you consult the directory to find out the members in the PDS. Just like in a book, the index tells you, the keyword you are looking for, and the page no. where it can be found, the same way, the directory tells you the member name, and the computer memory address where you can find it. Thus, the directory maintains the list of member-names and pointers to the actual physical place in Computer Memory where they are stored.

Not just this, but the directory also keeps track of its statistics, like when each member was created, when was it last changed/viewed by somebody, how much space it occupies, which TSO-userid created it and bla bla..

On the Windows Operating System, we generally keep related files together in a folder. On the same lines, you keep related members together in one PDS. Thus, a Partitioned Dataset is Mainframes-counterpart of Folders on Windows Operating System. Folders contain many related files. A PDS contains many related members.

When create this special type of partitioned sequential file – Partitioned Dataset, you need to decide, how big its directory is going to be. The bigger the directory, the more no. of partitions(members) it will support. You express this in terms of Directory Blocks. Generally, 1 directory block can store information about 5 members. The directory always remains fixed, can’t grow bigger on the fly, so you need to careful when specifying the directory blocks, and you have to do it in advance.

Image84[1]

To sum up, a Partitioned Dataset(PDS) is a specialised type of sequential file, which is divided into members, each member being a sequential dataset by itself. Thus, a PDS acts like a library which houses several related files.
Q. While creating a new file in ISPF, how do I specify whether is Sequential file(PS), or a Partitioned Dataset(PDS)?
A sequential PS File doesn’t have any partitions or members(0 members). So, it doesn’t have a directory to look upto. Thus, the space allocated to a directory, in terms of Directory Blocks for a Sequential PS File is 0.

On the other hand, for Partitioned Dataset(PDS), it can contain 1 or more members. So, it needs a directory to record the whereabouts(location) of its members, which are scattered throughout the memory randomly. You need to allocate space in terms of Directory Blocks to a Directory in Partitioned Dataset(PDS). Thus, Directory Blocks for a PDS should be some finite number, say 5 blocks, or 10 blocks.

Suppose you are creating a new File AGY0157.EMPLOYEE.DATA. You specify the Directory Blocks on the ISPF Menu 3.2 screen, as follows -

1. If you want the file AGY0157.EMPLOYEE.DATA to be a Physical Sequential File(PS), then fill the Directory Blocks field = 0.

Image85[1]

2. On the other hand, if you want the file AGY0157.EMPLOYEE.DATA to be a Partitioned Dataset(PDS), having 1 or many members, and a directory, specify Directory Blocks field = 1,2,3 or ...(any finite value) blocks. In the figure below, I have put Directory Blocks = 5 Blocks.

Image86[1]
Q. How do I find the file I want on Mainframes? How do you find/list files in ISPF?
You want to search and locate a file. Finding the file on MVS Operating System is done using, ISPF Menu 3.4, called Dataset List Utility. Go to ISPF Menu 3.4 screen, and type the name of the dataset that you want to search and hit Ctrl.

For example, if you want to search for the file AGY0157.EMPLOYEE.DATA, then type AGY0157.EMPLOYEE.DATA in Dsname field.

Image87[1]

Upon hitting the Ctrl button, you would find list of files displayed before. Note that, Dataset List Utility(DSLIST) works by searching for all files that match a pattern. So, when you type AGY0157.EMPLOYEE.DATA, what you actually specify is a pattern.

All files matching this pattern will be displayed. So, if there is a file – AGY0157.EMPLOYEE.DATA.MASTER, it also matches the pattern. Thus, it will also be listed.

Image88[1]

In fact, if you don’t know the exact name of your file, you can just specify the pattern followed by a wild-card. Say, for example, if you want to search for all the files starting with AGY0157.DEMO.something, then you can specify it as AGY0157.DEMO.*

Image89[1]

When you hit Ctrl, you would get the list of all datasets(files), whose names start with AGY0157.DEMO.

Image90[1]
Q. What if the file is Partitioned Dataset? How do you search the directory for the members in the PDS Library?
To see the directory of a PDS Library, you need to type M against the name of the Partitioned Dataset(PDS). The M Command tells the MVS Operating System to display the directory of the Partitioned Dataset(PDS).

Suppose, you want to see the directory(List of all the members) of the Partitioned Dataset(Library) AGY0157.DEMO.SRCLIB. Then, type an M against its name in the DSLIST Utility ISPF Menu 3.4 screen.

Image91[1]

Upon hitting the Ctrl Button, you get to see the directory of the Partitioned Dataset(PDS) AGY0157.DEMO.SRCLIB – you can see the entire list of members in the PDS.

Image92[1]

Generally, you will keep your program, jobs, REXX scripts assorted in Libraries or Partitioned Datasets(PDS). Here, I have stored all my COBOL Programs in this library.
Q. How do code member names of a Partitioned Dataset in JCL?
To refer to a member of a Partitioned Dataset in JCL, you code the dataset name with the member name in parenthesis. Here, is how you code my dataset name in JCL, when I have to refer to a job named PROGRAM1 in my SRCLIB (Source Library).

AGY0157.DEMO.SRCLIB(PROGRAM1)
Q. How do you store some data in file? How do open and edit the contents of a file?
In the next few tutorials, I’ll show you how to use JCL to run programs, read file, send output to printer, create and delete files. But, before this you need to key in some data into your computer system. This data consists of 80-byte records.

After creating a file, you need to an ‘E’ against the file-name to edit the file. Let’s assume that you wanted to key in Employee Data in Physical Sequential file – AGY0157.EMPLOYEE.DATA. Here goes. After you’ve found the file using ISPF Dataset List Utility 3.4, just type E against that dataset, and hit Ctrl.

Image93[1] 

Just as on Windows, the default editor in Notepad, typing E against the dataset name, causes the file AGY0157.EMPLOYEE.DATA to open in the editing mode. The editing mode allows you to change the contents of the file – add new data, modify the data, or delete the data. On the other hand, you can also open the file in View Mode (type V) or Browse Mode (type B). View Mode or Browse mode is a read-only mode(You cannot change the contents).

Generally, when you open Production Files(Files which are being used, when the Mainframe application is running live), it’s always a good practice to open them in read-only mode.

Initially, the file AGY0157.EMPLOYEE.DATA is empty. When you open it, in Editing mode, it looks like this -

Image94[1]

You can now key in your data in the file, and save it by typing the SAVE Command on the command line field.

Image95[1]

0 comments:

Post a Comment

Related Posts with Thumbnails

Quick Links

Jump to :  

Note :

© Copyright – Quasar Chunawalla, 2010.
Note : The copyrights of all the material, text and pictures posted in this website belong to the author. Any instance of lifting the material from this website, shall be considered as an act of plagiarism. For any clarifications, please mail at quasar.chunawalla@gmail.com
 
back to top