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
 

 

Vsam to Vsam file with different Record length

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Vsam to Vsam file with different Record length
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: 8057
Location: East Dubuque, Illinois, USA

PostPosted: Fri May 27, 2011 4:15 am    Post subject:
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    Post subject: Reply to: Vsam to Vsam file with different Record length
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: 8057
Location: East Dubuque, Illinois, USA

PostPosted: Fri May 27, 2011 5:15 am    Post subject:
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    Post subject: Reply to: Vsam to Vsam file with different Record length
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: 8057
Location: East Dubuque, Illinois, USA

PostPosted: Fri May 27, 2011 7:09 am    Post subject:
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    Post subject: Reply to: Vsam to Vsam file with different Record length
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    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 Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am


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