Is it possible to change the record length of a PS
Is it possible to change the record length of a PS
Hello,
Is it possible to change the record length of a sequential file that i have already defined?
Is it possible to change the record length of a sequential file that i have already defined?
-
- Global Moderator
- Posts: 490
- Joined: Sun Aug 25, 2013 7:24 pm
Re: Is it possible to change the record length of a PS
Yes. However, without some clue as to what you want to do, it is difficult to say anything beyond that. Once we know what you want, the answer may become No, or may remain Yes, but with additional details.
Re: Is it possible to change the record length of a PS
If your dataset is empty then simply delete it and redefine it.
If it has data in it that needs to be of the new record length then you will have to write something - possibly a sort - to read the old data, reformat it to the new format and write it out to a new dataset with the new dataset attributes. Once successful the old dataset can be deleted and the new one renamed to the old name. You will, of course, have to change any program that writes, reads or updates that dataset.
If it has data in it that needs to be of the new record length then you will have to write something - possibly a sort - to read the old data, reformat it to the new format and write it out to a new dataset with the new dataset attributes. Once successful the old dataset can be deleted and the new one renamed to the old name. You will, of course, have to change any program that writes, reads or updates that dataset.
Regards
Nic
Nic
- Anuj Dhawan
- Founder
- Posts: 2807
- Joined: Sun Apr 21, 2013 7:40 pm
- Location: Mumbai, India
- Contact:
Re: Is it possible to change the record length of a PS
Welcome to the Forums, Nic - nice to see you here!
To the question in the thread - I'd like to start with "No" - No. A new data-set with the other LRECL will have to be cataloged first, then the data from the original file can be copied in though as William said, follow up explanation might change the answer.
To the question in the thread - I'd like to start with "No" - No. A new data-set with the other LRECL will have to be cataloged first, then the data from the original file can be copied in though as William said, follow up explanation might change the answer.
Thanks,
Anuj
Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
Anuj
Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
-
- Global Moderator
- Posts: 588
- Joined: Wed Nov 20, 2013 11:53 am
- Location: Mars
Re: Is it possible to change the record length of a PS
IIRC there is a tool called STARTOOL if your shop uses that you could achieve it through that...
or
If the file is of GDG type then could create a new generation with different LRECL too
or
If the file is of GDG type then could create a new generation with different LRECL too
zprogrammer
-
- Global Moderator
- Posts: 832
- Joined: Wed Sep 11, 2013 3:57 pm
Re: Is it possible to change the record length of a PS
pretty bad practice IMO ...If the file is of GDG type then could create a new generation with different LRECL too
all the generations of a GDG should have the same dataset attributes !
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
Re: Is it possible to change the record length of a PS
I have the file in step1 of lrecl=80 and in some other JCL I want to modigy it to lrecl=90, this is what I wanted to ask. Sorry for any confusion.
Re: Is it possible to change the record length of a PS
We don't have STARTOOL.Pandora-Box wrote:IIRC there is a tool called STARTOOL if your shop uses that you could achieve it through that...
-
- Global Moderator
- Posts: 588
- Joined: Wed Nov 20, 2013 11:53 am
- Location: Mars
Re: Is it possible to change the record length of a PS
When you say you wanted to you wanted to modify lrecl=80 to 90 in another step what will the extra 10 bytes contain ??
And also in how many different place is the file with LRECL=80 is being used?
And also in how many different place is the file with LRECL=80 is being used?
zprogrammer
-
- Global Moderator
- Posts: 490
- Joined: Sun Aug 25, 2013 7:24 pm
Re: Is it possible to change the record length of a PS
The LRECL is just a piece of commentary. It is the maximum length of a logical record in a dataset.
If you want to "change" that, there is absolutely and utterly, utterly, no problem in doing so. Whether your data can still be read, depends on the data and what you are trying to read it with.
For instance, if you were using SORT, you could always specify a larger LRECL and process your data with no problem.
With a COBOL program you may run into problems.
Of course, this is not really what you want to do anyway. You want to make your records 10 bytes longer. You want to change the record-length of all the individual records (which have record-lengths, explicit or implicit) rather than "a PS", which does not have a record-length.
Terminology...
If you want to "change" that, there is absolutely and utterly, utterly, no problem in doing so. Whether your data can still be read, depends on the data and what you are trying to read it with.
For instance, if you were using SORT, you could always specify a larger LRECL and process your data with no problem.
With a COBOL program you may run into problems.
Of course, this is not really what you want to do anyway. You want to make your records 10 bytes longer. You want to change the record-length of all the individual records (which have record-lengths, explicit or implicit) rather than "a PS", which does not have a record-length.
Terminology...
Re: Is it possible to change the record length of a PS
I do not understand what the real problem is as it has not been explained as to why 10 more bytes are required. Assuming the requirement is to amend an existing dataset then the simplest way is to change the program that creates the dataset to declare the dataset as being 90 bytes record length, change the record declarations to the new length with the new/extended fields, assign data to those fields, change the record length in the JCL and change any downstream program that needs to read that dataset.
Regards
Nic
Nic
Re: Is it possible to change the record length of a PS
Code: Select all
//CHNLEN EXEC PGM=SORT
//SORTIN DD DISP=SHR,DSN=old.dataset
//SORTOUT DD DSN=new.dataset,DISP=(,CATLG,DELETE),...
//SYSOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
OUTREC FIELDS=(1,80,90:X)
/*
And this also worked, enter '/' beside the PS and choose option 17(copy). It will ask for DSname(give any). You will get 2 options as below
Selected '2' option from the above and changed the LRECL as needed.1. Allocate using same attributes
2. specify your own attributes
The reason was change in requirements where we needed longer LRECL for a newly defined dataset. The work was half way through so we thought of having a shortcut method.
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