View previous topic :: View next topic
|
Author |
Message |
abhay pratap singh
New User
Joined: 22 Nov 2007 Posts: 77 Location: noida
|
|
|
|
I have a physical sequential(PS) file which is VB and length of 14172. I want to remove data of 44th to 50th column and move data from 51st column to 44th column in the output file.
I tried using OUTREC facility in SORT utility but not getting the expected result. Below is the outrec statement i have used
Code: |
SORT FIELDS=COPY
OUTREC FIELDS=(1:1,43,44:51,14165)
|
Can anyone provide me solution. |
|
Back to top |
|
|
Alissa Margulies
SYNCSORT Support
Joined: 25 Jul 2007 Posts: 496 Location: USA
|
|
|
|
Try the following:
Code: |
SORT FIELDS=COPY
OUTREC FIELDS=(1:1,43,44:51)
|
|
|
Back to top |
|
|
priyesh.agrawal
Senior Member
Joined: 28 Mar 2005 Posts: 1448 Location: Chicago, IL
|
|
|
|
And since this is a VB file, you may want to take in account the first 4 RDW too.
So this is how your OUTREC should look like.
Code: |
OUTREC FIELDS=(1:1,4,5:5,43,48:55)
OR
OUTREC FIELDS=(1:1,47,48:55) |
|
|
Back to top |
|
|
abhay pratap singh
New User
Joined: 22 Nov 2007 Posts: 77 Location: noida
|
|
|
|
priyesh.agrawal wrote: |
And since this is a VB file, you may want to take in account the first 4 RDW too.
|
In case of PS do we also need to take care of 4 RDW bytes or it is in case of only VSAM files. |
|
Back to top |
|
|
Santoshdorge
New User
Joined: 27 Jun 2006 Posts: 48 Location: Pune
|
|
|
|
Hi
Quote: |
In case of PS do we also need to take care of 4 RDW bytes or it is in case of only VSAM files. |
We need to take care of 4 RDW bytes in case of VB record format no matter which file organisation you r using( PS/VSAM).
Thanks,
Santosh. |
|
Back to top |
|
|
abhay pratap singh
New User
Joined: 22 Nov 2007 Posts: 77 Location: noida
|
|
|
|
Thanks all for providing the solution. |
|
Back to top |
|
|
geethaelisha
New User
Joined: 03 Mar 2004 Posts: 1
|
|
|
|
Priyesh's reply was very useful for me. The second option given did not work for me. I had to give the RDW block separately. |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Always nice adding comments to a 3 year old thread |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
good to see that we have somebody who, contrary to the habits of these forums does some searching and reading on his own ! |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
And I wonder, geethaelisha, has made only 1 post since inception and that too of this nature! |
|
Back to top |
|
|
gylbharat
Active Member
Joined: 31 Jul 2009 Posts: 565 Location: Bangalore
|
|
|
|
priyesh.agrawal wrote: |
And since this is a VB file, you may want to take in account the first 4 RDW too.
So this is how your OUTREC should look like.
Code: |
OUTREC FIELDS=(1:1,4,5:5,43,48:55)
OR
OUTREC FIELDS=(1:1,47,48:55) |
|
Hi Priyesh,
Can you clarify one thing.... If we are copying 1st 4 bytes as it is... will it not make any problem as we are altering the VB length as not copying some bytes.?? |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1787 Location: Bloomington, IL
|
|
|
|
gylbharat wrote: |
priyesh.agrawal wrote: |
And since this is a VB file, you may want to take in account the first 4 RDW too.
So this is how your OUTREC should look like.
Code: |
OUTREC FIELDS=(1:1,4,5:5,43,48:55)
OR
OUTREC FIELDS=(1:1,47,48:55) |
|
Hi Priyesh,
Can you clarify one thing.... If we are copying 1st 4 bytes as it is... will it not make any problem as we are altering the VB length as not copying some bytes.?? |
Since Priyesh has not been heard from in nearly two years, I suspect that he will not clarify...
DFSORT would require the unedited RDW be copied. I can't say for certain, but it is very likely that SyncSort requires the same. |
|
Back to top |
|
|
gylbharat
Active Member
Joined: 31 Jul 2009 Posts: 565 Location: Bangalore
|
|
|
|
Akatsukami wrote: |
gylbharat wrote: |
priyesh.agrawal wrote: |
And since this is a VB file, you may want to take in account the first 4 RDW too.
So this is how your OUTREC should look like.
Code: |
OUTREC FIELDS=(1:1,4,5:5,43,48:55)
OR
OUTREC FIELDS=(1:1,47,48:55) |
|
Hi Priyesh,
Can you clarify one thing.... If we are copying 1st 4 bytes as it is... will it not make any problem as we are altering the VB length as not copying some bytes.?? |
Since Priyesh has not been heard from in nearly two years, I suspect that he will not clarify...
DFSORT would require the unedited RDW be copied. I can't say for certain, but it is very likely that SyncSort requires the same. |
As DFSORT requires the unedited RDW, Then how it is able to determine the correct length of the file? |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1787 Location: Bloomington, IL
|
|
|
|
gylbharat wrote: |
Akatsukami wrote: |
DFSORT would require the unedited RDW be copied. I can't say for certain, but it is very likely that SyncSort requires the same. |
As DFSORT requires the unedited RDW, Then how it is able to determine the correct length of the file? |
I do not know DFSORT/SyncSort internals, but I expect that they track the length of the logical record that they are working with, and update the RDW accordingly. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
As DFSORT requires the unedited RDW, Then how it is able to determine the correct length of the file? |
DFSORT does NOT require the unedited RDW for the reformatted record. It just requires the RDW (1,4) as a "placeholder" since a VB record requires an RDW as the first four bytes. DFSORT determines the record length dynamically and puts it in the first two bytes of the RDW. |
|
Back to top |
|
|
gylbharat
Active Member
Joined: 31 Jul 2009 Posts: 565 Location: Bangalore
|
|
|
|
Thanks Frank for the explanation... |
|
Back to top |
|
|
|