Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: How to change the record length of a dataset thru JCL?
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: 2360
Location: Israel

PostPosted: Tue Jan 24, 2006 4:40 pm    Post subject:
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    Post subject:
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: 2360
Location: Israel

PostPosted: Tue Jan 24, 2006 6:17 pm    Post subject:
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    Post subject:
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    Post subject:
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

Moderator Team Head


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

PostPosted: Tue Jan 24, 2006 7:15 pm    Post subject: Re: How to change the record length of a dataset thru JCL?
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    Post subject: Re: How to change the record length of a dataset thru JCL?
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts FTP - JCL failed while passing FTP co... Suneetha1612 JCL & VSAM 12 Wed Nov 16, 2016 7:33 pm
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts SQZ pipe delimited file with 1 column... Rick Silvers DFSORT/ICETOOL 2 Sun Nov 06, 2016 8:11 pm
No new posts Joinkeys operation when key1 and key2... Susanta DFSORT/ICETOOL 5 Wed Nov 02, 2016 5:35 pm
No new posts To trim spaces in a pipe delimited da... Nish84 COBOL Programming 16 Mon Oct 10, 2016 1:54 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us