Page 1 of 1

Changinging the definition of variables in file.

Posted: Mon Jul 21, 2014 3:40 pm
by Kailash
Hi,

I've a file with below desciption:
old file -

Code: Select all

x(03) 
x(02) 
x(04) 
x(02) 
x(05) 
x(06) 
x(04) 
x(03) 
s9(11)v99 comp-3 
s9(11)v99 comp-3 
s9(11)v99 comp-3 
s9(11)v99 comp-3 
s9(11)v99 comp-3 
s9(11)v99 comp-3 
x(49) (filler) 
new file-

Code: Select all

x(03) 
x(02) 
x(04) 
x(02) 
x(05) 
MMDDYYYY( here yyyy = 20yy, 20 is constant) 
x(04) 
x(03) 
x(13) 
x(13) 
x(13) 
x(13) 
x(13) 
x(13) 
Length of both the files is 120.

What approach should I follow to do this, please guide.

Re: Changinging the definition of variables in file.

Posted: Mon Jul 21, 2014 7:24 pm
by Robert Sample
You did NOT provide anywhere near enough information for an informed answer. Is the data set a VSAM or sequential file? If VSAM, is it ESDS, KSDS, RRDS? How many records are in the data set?

Assuming you have a sequential data set, and the ONLY change you are making is adding the 20 in those two bytes, use SORT to copy the current data set to a new data set, inserting the two bytes into each record. Or you can write a program in the language of your choice to do the same.

Note that such changes usually impact far more -- every other program that reads / writes the data set must be modified as well before the new data set is used.

Re: Changinging the definition of variables in file.

Posted: Mon Jul 21, 2014 10:27 pm
by nicc
Are you really converting the 7 byte comp-3 fields to 13 byte alpha numeric-fields? I haven't checked that both layouts do total 120 and how about your FILLER?