IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to change the record length of a dataset thru JCL?


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Matty

New User


Joined: 14 Dec 2005
Posts: 4
Location: Pune, India

PostPosted: Tue Jan 24, 2006 12:56 pm
Reply with quote

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
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Tue Jan 24, 2006 4:40 pm
Reply with quote

Yes, you can do that in one step using IEBGENER.

O.
Back to top
View user's profile Send private message
MGIndaco

Active User


Joined: 10 Mar 2005
Posts: 432
Location: Milan, Italy

PostPosted: Tue Jan 24, 2006 4:48 pm
Reply with quote

Really interesting.
Mr O, are you sure that you can do it in only one step? icon_confused.gif
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Tue Jan 24, 2006 6:17 pm
Reply with quote

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
View user's profile Send private message
MGIndaco

Active User


Joined: 10 Mar 2005
Posts: 432
Location: Milan, Italy

PostPosted: Tue Jan 24, 2006 6:33 pm
Reply with quote

Ok, but is not the same dataset... icon_wink.gif
Back to top
View user's profile Send private message
MGIndaco

Active User


Joined: 10 Mar 2005
Posts: 432
Location: Milan, Italy

PostPosted: Tue Jan 24, 2006 7:02 pm
Reply with quote

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
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Tue Jan 24, 2006 7:15 pm
Reply with quote

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
View user's profile Send private message
Matty

New User


Joined: 14 Dec 2005
Posts: 4
Location: Pune, India

PostPosted: Tue Jan 24, 2006 8:18 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 7
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts To find whether record count are true... DFSORT/ICETOOL 6
Search our Forums:

Back to Top