Changinging the definition of variables in file.

JES2/3, JCL, utilities.
Kailash
Registered Member
Posts: 10
Joined: Thu Nov 21, 2013 11:53 pm

Changinging the definition of variables in file.

Post 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.
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1905
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: Changinging the definition of variables in file.

Post 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.
nicc
Global Moderator
Global Moderator
Posts: 690
Joined: Wed Apr 23, 2014 8:45 pm

Re: Changinging the definition of variables in file.

Post 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?
Regards
Nic
Post Reply Previous topicNext topic

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “JCL - Job Control Language.”