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.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
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-?
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.
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.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
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: