View previous topic :: View next topic
|
Author |
Message |
HozE
New User
Joined: 21 Feb 2007 Posts: 6 Location: Mumbai
|
|
|
|
I have this requirement like copying data from file 1 (column 1-5) to file 2 (column 10-15). Can anybody please provide a solution for this? |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Which utility / program did you envisage using ?
What have you tried yourself and what errors do you need help in resolving ? |
|
Back to top |
|
|
HozE
New User
Joined: 21 Feb 2007 Posts: 6 Location: Mumbai
|
|
|
|
I would be using the sort utility.
However i havent tried it because I dont know the exact syntax that is required for this process. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
HozE wrote: |
I would be using the sort utility.
However i havent tried it because I dont know the exact syntax that is required for this process. |
Sigh ................... How do you think that so many other people get experience in all of these products.
It is the very best way to learn - Trial & Error. How do you think that us oldies managed to find things out long before help forums were readily available on the net ? |
|
Back to top |
|
|
HozE
New User
Joined: 21 Feb 2007 Posts: 6 Location: Mumbai
|
|
|
|
Expat, I totally agree with you...no doubt...u cant run until u learn to walk.
I wud have done some research before posting, but time is not on my side rite now. If you can help, it would really be appreciable. |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
why does it need 6 bytes of output when only five bytes are moved ?
I'm just been picky as I don't think the requestor tried very hard at solving the problem.
Gerry |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
You can use DFSORT control statements like this:
Code: |
OPTION COPY
INREC BUILD=(c:p,m)
|
where c is the starting positon in the output file, p is the starting position of the input field and m is the length of the input field. So for example:
Code: |
OPTION COPY
INREC BUILD=(10:1,5)
|
If you really want to copy the 5 byte field in 1-5 to the 6 byte field in 10-15, you can use this:
Code: |
OPTION COPY
INREC BUILD=(10:1,5,X)
|
where the X is a blank.
If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:
Use [URL] BBCode for External Links |
|
Back to top |
|
|
|