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

How to copy the data from a VSAM file


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
pnkumar
Warnings : 2

New User


Joined: 27 Oct 2005
Posts: 24

PostPosted: Tue Aug 05, 2008 7:51 am
Reply with quote

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

DFSORT Developer


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

PostPosted: Tue Aug 05, 2008 10:22 pm
Reply with quote

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
View user's profile Send private message
pnkumar
Warnings : 2

New User


Joined: 27 Oct 2005
Posts: 24

PostPosted: Thu Aug 07, 2008 8:39 am
Reply with quote

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

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Aug 07, 2008 8:55 am
Reply with quote

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

DFSORT Developer


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

PostPosted: Fri Aug 08, 2008 2:01 am
Reply with quote

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
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 8
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts Need help for File Aid JCL to extract... Compuware & Other Tools 23
Search our Forums:

Back to Top