Extra Credit Assignment 3
DFSORT, IEBGENER and IEBPTPCH
(20 points extra credit)
Create and run a multistep job using the utility programs to perform
the operations described below. Use proper JCL documentation.
Input
Two input files are involved here, all catalogued:
- OLDUSER has data set name KC02314.SUMMER09.CSCI465.EXTRA3.OLDUSER.
- NEWUSER has data set name KC02314.SUMMER09.CSCI465.EXTRA3.NEWUSER.
The records in OLDUSER have this format:
- First name.........columns 1-10, alphabetic
- Last Name..........columns 13-22, alphabetic
- ID.................columns 25-33, numeric
- LogonID............columns 36-42, alphanumeric
- Password...........columns 45-52, alphanumeric
- Account Balance....columns 55-60, signed numeric, dollars and cents
- Credit Rating......column 63, signed numeric
The records in NEWUSER have this format:
- ID.................columns 1-9, numeric
- LogonID............columns 12-16, alphanumeric
- Last Name..........columns 19-28, alphabetic
- First Name.........columns 31-40, alphabetic
- Password...........columns 43-50, alphabetic
Processing
Your job should contain the following steps:
- Use IEBPTPCH to print the first 10 records in the OLDUSER file
using IEBPTPCH's default format (no RECORD FIELD). You should
have a page heading (centered), and the output should be triple-spaced.
- Use IEBGENER to copy OLDUSER into a new permanent file, making a
few changes:
Rearrange the fields into this order:
- First name
- Last Name
- Password
- LogonID
- ID
- Credit Rating
- Account Balance
Give the new file a name of the form Znumber.OLDUSER, where
Znumber is your own LogonID.
- Use IEBGENER to copy NEWUSER into a new file, making a few
changes:
- The existing LogonID is 5 characters long. It should be 7, so
add the user's initials at the beginning and end. That is, if the
user's name is Kathy Jones and her LogonID (in NEWUSER) is 12345,
then her LogonID (in the new file) should be K12345J.
- The Account Balance should be 0.
- The Credit Rating should be 0.
- Rearrange the fields into the order described above for the
new OLDUSER.
Give the new file a name of the form Znumber.NEWUSER, where
Znumber is your own LogonID.
- Use DFSORT to sort the two new files created in steps 2 and 3,
concatenated together in SORTIN, in ascending order on the LogonID
field, creating a temporary file called &&MERGE.
- Use IEBGENER to make a copy of &&MERGE. Pack all of the numeric
fields. Make no other changes. The new copy should be in a
permanent file with a name of the form Znumber.PACKED.
- Use IEBPTPCH to print the first 15 records of the new
PACKED file in hexadecimal format, double-spaced. Use a page
heading (centered), but there is no need for column headings or
separation between fields.
- Use IEBPTPCH to print the PACKED file into a temporary file called
&&LAST, converting the numeric fields to zoned decimal format,
single-spaced, without a page heading. Do nothing more.
- Use IEBGENER to copy &&LAST into a new permanent file with a name
of the form Znumber.NEATCOPY, making the following changes:
- Remove the carriage-control character in column 1.
- Insert a dollar sign at the left of the Account Balance field and a
decimal point between the dollars and cents.
- Remove the sign digit from the end of the ID field.
- Insert dashes into the ID field so the numbers are in the form
999-99-9999.
- Use IEBPTPCH to print NEATCOPY. You should provide a page heading
and column headings. Center the output on the page and leave some
space between columns. Make it double-spaced. You may need to use
STRTAFT=1. (Figure out why!)
- Use IEFBR14 to delete all the files you have been creating in the
above steps.
Notes
- Until the last IEBPTPCH step, do not insert any extra spaces into any
of the files. Make each LRECL as small as you can.
- When you create the new files using IEBGENER, you will need to supply
DCB information on the DD statements.
- Put appropriate COND parameters on the steps that need them. Use
COND=EVEN on the last step.
- Please don't do any extra steps. This is long enough as it is. As
you work on it, though, it may be necessary to run some extra IEFBR14
jobs to delete files from time to time.