Вы находитесь на странице: 1из 2

File Layout

Raw file : DSRC072.GET78.COBOL.RAW (LRECL=90). There are no filler in between fields

PSID FNAME LNAME MOBILE LOCATION EMAIL SALARY


9(8) X(15) X(15) 9(10) X(10) X(25) 9(06)V9(02)

Valid Data file : <HLQ>.GET738.VALIDDTA (LRECL=90, PSID is key). There are no filler in between
fields

PSID1 NAME MOBILE1 LOCATION1 EMAIL1 SALARY1


X(9) X(20) 9(10) X(10) X(25) $(07).9(02)

Valid Data file : <HLQ>.GET738.INVALID. DATA (LRECL=90). There are no filler in between fields

PSID2 FNAME2 LNAME2 MOBILE3 LOCATION3 EMAIL3 SALARY3


9(8) X(15) X(15) 9(10) X(10) X(25) 9(06)V9(02)

Write 2 COBOL programs to do the following:

Program 1:

1. Member name : CODE0001


2. The COBOL code in the member CODE0001 will do the following process
a. Read the Raw file DSRC072.GET738.COBOL.RAW and do the validation as given.
b. Once the validations are completed write the valid data into a KSDS dataset
<HLQ>.GET738.VALIDDTA with key as PSID1 and record size 90. The format of PSID1
in KSDS dataset is #<PSID>. For example if PSID is 12345678 then PSID1 should be
#12345678
c. The invalid records should be written in a PS file <HLQ>.GET738.INVALID.DATA
d. Name field in Valid Data file should be <first character of last name>.<first name>
For example: If FNAME is RAJ and LNAME is NIVAS, then NAME should be N.RAJ
3. Validations to be performed
a. PSID must be numeric
b. EMAIL should be alphanumeric
c. SALARY should not be less than 5000 and greater than 20000
d. FNAME and LNAME should not be spaces

Program 2:

1. Member Name: CODE0002


2. The COBOL code in the member CODE0002 will do the following process
a. Read the Valid Data file from Program 1 as input and provide a 10 % bonus for all the
employees
b. Display the PSID1, current Salary, Incremented Salary and Incremented amount in
SPOOL

After coding and compiling the above said programs, write a JCL code to do the folliwng:

STEP 1 : Delete and Create Valid Data file

STEP 2 : Run the cobol program CODE0001

STEP 3 : Run the cobol program CODE0002

Note: The following points are hints to proceed the code.

a) In edited picture clause variable, arithmetic operations cannot be performed.


b) Moving of EDITED to normal variable and normal variable to EDITED picture clause variable
is possible.
c) The KSDS file used in the program is a new file created in JCL STEP1
d) Create the PS output files dynamically
e) Calculate the remaining fillers properly.

Вам также может понравиться