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

Vsam to Vsam file with different Record length


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

New User


Joined: 07 Jun 2010
Posts: 59
Location: coimbatore

PostPosted: Fri May 27, 2011 3:59 am
Reply with quote

Hi,

I need to repro a vsam file to anothe vsam file with different record length. (KSDS)

My first vsam file(ksds) has 206 as record length key(6,0)...
My second vsam file(ksds) should have 1030 as record length key(6,0)..

Here i created my second vsam file and repro it from first vsam file.
But i couldnt edit it after the position of 206. why its padding with Nulls and not with blanks.

How to acheive it via a JCl.

My job
Code:

//*CREATING VSAM                                               
//STEP1 EXEC PGM=IDCAMS                                         
//SYSPRINT DD SYSOUT=*                                         
//SYSOUT   DD  SYSOUT=*                                         
//SYSIN DD *                                                   
               DEFINE CLUSTER -                                 
               ( -                                             
               NAME(Vsam-file-2) -               
               TRACKS(4,2) -                                   
               CONTROLINTERVALSIZE(4096) -                     
               RECORDSIZE(1030,1030) -                         
               FREESPACE(10,20) -                                                                   
               KEYS(6,0) -                                             
                ) -                                                     
               DATA -                                                   
               ( -                                                     
                NAME(Vsam-file-2.DATA) -                 
                ) -                                                     
               INDEX -                                                 
               ( -                                                     
               NAME(Vsam-file-2.INDEX) -                 
               CONTROLINTERVALSIZE(2048) -                             
               )                                                       
//STEP3 EXEC PGM=IDCAMS                                                 
//INDD  DD DSN=Vsam-file-1,DISP=SHR                     
//OUTDD DD DSN=Vsam-file-2,DISP=SHR                       
//SYSOUT   DD  SYSOUT=*                                                 
//SYSTSPRT DD  SYSOUT=*   
//SYSPRINT DD  SYSOUT=*           
//SYSABOUT DD  SYSOUT=*           
//SYSDUMP  DD  SYSOUT=*           
//SYSUDUMP DD  SYSOUT=*           
//ABENDAID DD  SYSOUT=*           
//SYSIN DD *                       
  REPRO INFILE(INDD) OUTFILE(OUTDD)                                             

let me know if you need further clarifications.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Fri May 27, 2011 4:15 am
Reply with quote

Quote:
why its padding with Nulls and not with blanks.
Because that's the way IDCAMS works. If you want different results, you'll need to do something different -- for example, unload the VSAM file, use IEBGENER to reformat the records to the new length, then load from the new file.
Back to top
View user's profile Send private message
sabarikanth

New User


Joined: 07 Jun 2010
Posts: 59
Location: coimbatore

PostPosted: Fri May 27, 2011 4:28 am
Reply with quote

Quote:
unload the VSAM file, use IEBGENER to reformat the records to the new length, then load from the new file.


Yes Bob,

I tried with that option also but i couldn't edit after 206 position.

i tried to copy to a flat file with lrecl of 1030 and repro to Vsam-file-2. No use... icon_sad.gif

Is ter any other way to get this done..?

Thanks,
Sab.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Fri May 27, 2011 5:15 am
Reply with quote

Terminology note: files do not have "nulls" -- that concept only applies when dealing with databases. Every byte of a file has a value in the collating sequence. That value may be X'00' or X'C1' or even X'FF' -- but there is a value, not "null".

1. The name is "Robert", not "Bob".

2. What are you attempting to use to edit the file? Most edit packages allow you to treat LOW-VALUES like spaces.

3. Did you use the field option in IEBGENER to force the last 824 bytes to be spaces? If not, why not?

4. Another way would be to allocate a flat file of 206 byte records and one of 1030 byte records. Unload the VSAM file into the 206 byte record file. Use TSO to edit the 1030 byte record file and copy the 206 byte record into it. Save and use that to load the 1030 byte VSAM file. The last 824 bytes will be spaces if you do this.
Back to top
View user's profile Send private message
sabarikanth

New User


Joined: 07 Jun 2010
Posts: 59
Location: coimbatore

PostPosted: Fri May 27, 2011 5:46 am
Reply with quote

Ok Robert.

Quote:
Did you use the field option in IEBGENER to force the last 824 bytes to be spaces? If not, why not?


Please help me how to move spaces for these 824 bytes.


thanks,
sab
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Fri May 27, 2011 7:09 am
Reply with quote

Since you're on the forum, I assume you can read. Click on the Manuals link at the top of the page, find the Utilities manual (last manual in the Batch Processing group), and start reading on the parameters of IEBGENER. That will tell you how to do what you want. Once you've read, and tested, THEN if you have questions, ask. But this is purportedly a forum for professionals, which should mean we don't have to spoon-feed things to you -- you should be able to read, comprehend, and use manuals.
Back to top
View user's profile Send private message
jerryli

New User


Joined: 21 Sep 2009
Posts: 2
Location: Taipei

PostPosted: Fri May 27, 2011 12:39 pm
Reply with quote

sabarikanth:

If you can using SORT, this job can give the result you want (copy record and fill 824 spaces):

Code:
//SORT3   EXEC PGM=SORT                                 
//SYSOUT   DD SYSOUT=*                                   
//SORTIN   DD DISP=SHR,DSN=Vsam-file-1   
//SORTOUT  DD DISP=SHR,DSN=Vsam-file-2         
//SYSIN    DD *                                         
   SORT FIELDS=COPY                                     
   OUTFIL BUILD=(1,206,824X)                             
//*                                                     
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 FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Store the data for fixed length COBOL Programming 1
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
Search our Forums:

Back to Top