IBM MAINFRAME HELP & SUPPORT FORUMS
Technical Forums for IBM Mainframe Applications like COBOL, JCL, CICS, DB2, FileAid, DFSORT, Endevor, Xpediter, CoolGen, CA-7&11, AbendAid, IMS, IDMS, PL/I, MqSeries, SyncSort, Assembler, ChangeMan, Easytrieve, InterTest, REXX, CLIST etc...
 

How to copy the data from a VSAM file

THIS IS AN ARCHIVE FORUM: CLICK HERE TO GO TO THE ORIGINAL TOPIC

 
       IBMMAINFRAMES.com - IBM Mainframe Support Forums Index -> DFSORT/ICETOOL
View previous topic :: View next topic  
Author Message
pnkumar



Joined: 27 Oct 2005
Posts: 10

Posted: Tue Aug 05, 2008 7:51 am    Post subject: How to copy the data from a VSAM file  

Hi,
My requirement is like this. I have a VSAM fle having a length of 2500 and is a FB. Now the file length is changed to 3000 with some addition of the filler and some offset changes, i mean upto the length of 1500 the record layout is same and after that 15 new fields are added with a length of 300 bytes and remaing length of 200 has been added as a filler at the end of the record.

Now i want to copy the data from old file (2500 length) to the new file with first 1500 bytes of old file to the first 1500 of new file then initialize the new fileds and again copy the remaining 1000 bytes of old file to new file starting from positon 1801 (1500+300), and the last 200 bytes will also be initialized.
Back to top  
Frank Yaeger



Joined: 15 Feb 2005
Posts: 4613
Location: San Jose, CA

Posted: Tue Aug 05, 2008 10:22 pm    Post subject:  

Huh? It's not clear from your description what the output records will look like. You talk about initializing fields but you don't say what they should be initialized to. And it's not clear which input fields go where in the output record. It would help if you'd show a layout something like this:

Output Record

1-1500: Input positions 1-1500
1501-1800: initialized to ?
1801-?

But show it as you really want it.
Back to top  
pnkumar



Joined: 27 Oct 2005
Posts: 10

Posted: Thu Aug 07, 2008 8:39 am    Post subject:  

The layout is like this

Input file
1-2500 : having numeric and alpha numeric fields

Output file

1-1500: Input positions 1-1500
1501-1800: initialized to zeroes if the field is numeric and initialized with spaces if the field is alphanumeric, for example the position 1501 to 1510 is a numeric field then it should be initialized to zeroes and if 1511-1540 is an alphanumeric then it should be initialized to spaces and again if 1541-1555 and 1556-1569 having numeric fields then it should be initialized to zeroes, like this based on offset it should be initialized to zeroes or spaces.
1801-2800 : Input positions 1501-2500
2801-3000 : Initialized to spaces.

Thanks
Nagaraja
Back to top  
dick scherrer



Joined: 23 Nov 2006
Posts: 8733
Location: 221 B Baker St

Posted: Thu Aug 07, 2008 8:55 am    Post subject:  

Hello,

Quote: initialized to zeroes if the field is numeric and initialized with spaces if the field is alphanumeric The sort will not detect field type - you must define the fields.

As you use OVERLAY or BUILD to create the output, you may put spaces, zeros, or any other value in each field of the output data.

This previous topic should have info and links to documentation that will help:
http://ibmmainframes.com/viewtopic.php?t=23511

Once you begin to format/initialize your output fields, there may be questions or errors encountered. Post your code, what you are trying to do at that point, and what question or error you encounter.
Back to top  
Frank Yaeger



Joined: 15 Feb 2005
Posts: 4613
Location: San Jose, CA

Posted: Fri Aug 08, 2008 2:01 am    Post subject:  

Nagaraja,

The information you've supplied is too vague. I don't know what your fields look like or how they are defined exactly. I can only tell you that you can do the kind of thing you're asking about using DFSORT's IFTHEN function. The DFSORT control statements might look something like this, but you'd have to fill in the specifics:

Code:
    OPTION COPY                                           
    RECORD TYPE=F
    INREC IFTHEN=(WHEN=INIT,OVERLAY=(2801:200X)),       
          IFTHEN=(WHEN=(1501,10,FS,EQ,NUM),             
              OVERLAY=(1501:10C'0'),HIT=NEXT),           
          IFTHEN=(WHEN=(1501,10,FS,NE,NUM),             
              OVERLAY=(1501:10X),HIT=NEXT),             
          IFTHEN=(WHEN=(1511,30,FS,EQ,NUM),             
              OVERLAY=(1501:30C'0'),HIT=NEXT),           
          IFTHEN=(WHEN=(1511,30,FS,NE,NUM),             
              OVERLAY=(1501:30X),HIT=NEXT),
          ...               
Back to top  
 
       IBMMAINFRAMES.com - IBM Mainframe Support Forums Index -> DFSORT/ICETOOL
Page 1 of 1
THIS IS AN ARCIVE FORUM IN READ ONLY MODE. IF YOU WANT TO ASK YOUR DOUBTS USE THE ACTUAL FORUM