View previous topic :: View next topic
|
Author |
Message |
Matty
New User
Joined: 14 Dec 2005 Posts: 4 Location: Pune, India
|
|
|
|
I have one dataset (for ex. TEST.DAT') with record length 256. It is having some data also.
Now I want to reduce its record length to 80 thru JCL. Data truncation is not a problem. Only first 80 characters is enough. Here my condition is the output file should also have the same name (TEST.DAT) but with the record length 80.
Is there any single step to do this? |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
Yes, you can do that in one step using IEBGENER.
O. |
|
Back to top |
|
|
MGIndaco
Active User
Joined: 10 Mar 2005 Posts: 432 Location: Milan, Italy
|
|
|
|
Really interesting.
Mr O, are you sure that you can do it in only one step? |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
I just tried it, to make sure:
Code: |
//OFERFFT JOB (),@IEBG,MSGCLASS=T,CLASS=A,NOTIFY=&SYSUID
//**********************************************************************
//* IEBGENER UTILITY *
//**********************************************************************
//IEBG EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=OFERF.IFS,DISP=SHR
//SYSUT2 DD DSN=OFERF.IFR,DISP=SHR
//SYSIN DD *
GENERATE MAXFLDS=1
RECORD FIELD=(80)
/* |
Where LRECL of 'OFERF.IFS' = 3000 and LRECL of 'OFERF.IFR' = 80.
O. |
|
Back to top |
|
|
MGIndaco
Active User
Joined: 10 Mar 2005 Posts: 432 Location: Milan, Italy
|
|
|
|
Ok, but is not the same dataset... |
|
Back to top |
|
|
MGIndaco
Active User
Joined: 10 Mar 2005 Posts: 432 Location: Milan, Italy
|
|
|
|
Ofer is right but you must do it in 2/3 step:
1) copy your file reblocking the content(as suggest ofer)
2) delete input file and reload it with new
or
1) rename your input file
2) copy the file, using the Ofer's method, in the original dataset
Depend on your usage of dataset(if temporary or not) you must use a delete before allocate the output dataset.
I hope in this. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
I don't see where there is any way this can be done in a single job step. Sure, you can use IEBGENER or DFSORT/ICETOOL/SYNCSORT/SYNCTOOL to truncate the dataset to a temporary dataset, but the original dataset must be deleted, and then a new copy cataloged, which will require at least two job steps to avoid the JCL error.
The only way I can see this happening within a single job step is using a program and dynamic allocation/de-allocation of the required datasets. |
|
Back to top |
|
|
Matty
New User
Joined: 14 Dec 2005 Posts: 4 Location: Pune, India
|
|
|
|
Thank you guys for your reply.
I just wanted to know whether there is any simple way to do this.
Now I have done this with two steps as told by SuperK
Once again thanks to you all!
Regards,
Matty |
|
Back to top |
|
|
|