IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Create the VSAM Master file (KSDS) using IDCAMS utility


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Lavanya_Dhushetty
Warnings : 2

New User


Joined: 30 Aug 2007
Posts: 24
Location: Chennai

PostPosted: Fri Sep 07, 2007 11:24 am
Reply with quote

1) Create the VSAM Master file for Employee Information

a) Create the VSAM Master file (KSDS) using IDCAMS utility. Use the following attributes for the
creation of the VSAM file.

Record format FB Primary Extents 2 Cylinders
Record Length 200 Secondary Extents 5 Cylinders
Key First 6 bytes of the file

Follow the naming conventions as given below:-

<userid>.UNCD.EMP.CLUSTER
<userid>.UNCD.EMP.DATA
<userid>.UNCD.EMP.INDEX

b) The VSAM File will have the following layout:-

Se. No. Field Name Length Description/Comments
1 Emp-ID X(6) Key Field – Starting from 100001 – Increment by 1
2 Emp-Type-Code X(2) Valid Values : PA/A/SA/PM
3 License-Valid X Values – ‘Y’ and ‘N’
4
First Name X(20)
5 Middle Name X
6 Last Name X(20)
7 Date-of-birth MM-DD-YY
8 Marital Status X Valid Values: ‘S’,’D’,’M’ (Single/Divorced/Married)
9 Sex-Code X Valid Values: ‘M’ and ‘F’
10 SSN X(11) Data Format: 999-99-9999
11 Policy-No X(6)


2) Create the VSAM Master file for Policy’s Information

a) Create the VSAM Master file (KSDS) using IDCAMS utility. Use the following attributes for the
creation of the VSAM file.

Record format FB Primary Extents 2 Cylinders
Record Length 200 Secondary Extents 5 Cylinders
Key First 6 bytes of the file

Follow the naming conventions as given below:-

<userid>.UNCD.POLICY.CLUSTER
<userid>.UNCD.POLICY.DATA
<userid>.UNCD.POLICY.INDEX


b) The VSAM File will have the following layout:-



Se. No. Field Name Length Description/Comments
1 Policy-Id X(6) Key Field – Starting from A00001 – Increment by 1
2 Policy-Eff-Date MM-DD-YY
3 Policy-End-Date MM-DD-YY
4 Policy-Status X A- Active;I –Inactive
5 Policy-Owner-Name X(30)


b) Load the VSAM File with at least 10 records. This set of records should contain/satisfy the following conditions:

1) Valid records should contain valid values wherever applicable.
The list of valid values have been provided in the Description/comments column.
Date validation (Effective/End date are valid and current date fall between these)

2) Atleast one record should have Emp-Type-Code other than specified in the description columns so that it is errored out.

3) Create a sequential Error Report File.

4) Create a Header /Trailer will contain the statistics

This file is for storing erratic records (To report fields that have invalid values)

Record format FB Primary Extents 10 Tracks
Record Length 80 Secondary Extents 10 Tracks

The file should have the following layout:-

Se. No. Field Name Length Description/Comments
1 Emp-Id X(6) First 6 bytes of the VSAM Master file
2 Error-Code X(3) E01 – Invalid Emp-Type
E02 – Inactive – Other

3 Error-Field-Name X(30) Name of the field that has invalid value
4 Error-field-value X(20) The invalid field value
5 Error-Comments X(21) Description/reason for invalidity


5) Create Output File with the following structure:-

Record format FB Primary Extents 2 Cylinders
Record Length 200 Secondary Extents 5 Cylinders



Se. No. Field Name Length Description/Comments
1 Reference ID (PK) Unique Key – Auto Generated (Start with 900005) – Increment by 1
2 First Name X(20)
3 Middle Name X
4 Last Name X(20)
5 DOB MM-DD-YY
6 Sex Code X
7 Marital Status X
8 SSN X(11)
9 Policy-Id X(6)
10
Policy-Eff-Date MM-DD-YY
11 Policy-End-Date MM-DD-YY
12 Policy-Status X
13 Policy-Owner-Name X(30)

6) Guidelines for COBOL Program:-

&#61656; The Program should read the VSAM file, do the processing and write into the OUTPUT file or error file accordingly.

&#61656; You can populate the input VSAM files through FileAid options.

&#61656; All error conditions must be handled in your program. File Status should be checked for every Open, Read and Write operations.

&#61656; Do not use ‘Go to’ statements in the programs

&#61656; The program should follow top-to-bottom approach.

&#61656; Use scope terminators appropriately.


This is my Program .I am reading the emp file sequentially and sending the policy id of employee file to policy id of policy file.But when reading the policy file it is showing error as file status 23(record not found).Pls Cold someone help on this?????
Back to top
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 691
Location: Earth

PostPosted: Fri Sep 07, 2007 11:40 am
Reply with quote

[quote]file status 23(record not found).quote].
well, it also indicates FILE NOT FOUND...
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Fri Sep 07, 2007 11:52 am
Reply with quote

Abhijit,

Quote:
well, it also indicates FILE NOT FOUND...


True for OPTIONAL files.
Back to top
View user's profile Send private message
rajaherein

New User


Joined: 11 Jan 2007
Posts: 23
Location: chennai

PostPosted: Fri Sep 07, 2007 12:00 pm
Reply with quote

Please post your COBOL code involving the matching logic. May be the Policy ID of Policy File and Policy No of Employee File are wrongly loaded. Check the Policy ID of Policy file and Policy No of Employee File.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Unable to interpret a hex value to De... COBOL Programming 4
No new posts how to eliminate null indicator value... DB2 7
No new posts How can I add/create a new INIT(initi... TSO/ISPF 2
No new posts Use Copy Utility DB2 7
No new posts VSAM LISTCAT INFORMATION JCL & VSAM 2
Search our Forums:

Back to Top