View previous topic :: View next topic
|
Author |
Message |
mahi
New User
Joined: 04 Apr 2006 Posts: 86 Location: Hyderabad
|
|
|
|
Hi,
I am trying to copy one column of the VB length record file to output VB record. But to do this we need to specify the first 4 bytes to RDW of the variable-length output record.
But I am not sure how to specify the first 4 bytes to RDW. Can any one help to solve this. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
What do you mean you have to specify the first 4 bytes ?
What have you tried so far, and what were the results.
What examples have you looked at
Take a look at the reference material thread posted by Frank, and then go look at the books. All will be revealed. |
|
Back to top |
|
|
mahi
New User
Joined: 04 Apr 2006 Posts: 86 Location: Hyderabad
|
|
|
|
thanx...
I will look in to the material ... |
|
Back to top |
|
|
mahi
New User
Joined: 04 Apr 2006 Posts: 86 Location: Hyderabad
|
|
|
|
Hi Expat,
I have referred some material, in that it is mentioned "For variable-length records, the first entry in the FIELDS parameter must specify or include the 4-byte record descriptor word (RDW). DFSORT sets the length of the reformatted record in the RDW. "
Here my question is how to specify or include the 4-byte RDW? I want to know the syntax for that...I have'nt find syntax in that material..
Please suggest... |
|
Back to top |
|
|
cvadlamudi
New User
Joined: 19 Apr 2007 Posts: 68 Location: India
|
|
|
|
mahi,
I think you are trying to copy a VB file to FB file.. rite.. if so then you have to use the 'CONVERT' or 'VTOF' option in the sort.. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Yes, you could copy to an FB file also.
For the VB to VB, OUTFIL OUTREC=(1,4,29,44) |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
OUTFIL OUTREC=(1,4,29,44)
The RDW is (1,4
The data being copied is 29,44 |
|
Back to top |
|
|
mahi
New User
Joined: 04 Apr 2006 Posts: 86 Location: Hyderabad
|
|
|
|
Thank You Expat...
I want to copy the 10 to 20 bytes of input to output file then how should I specify the OUTREC...?
Is it like OUTREC FIELDS-(1,4,5:10,10)??? |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
I would guess that depends one the sort product you are using,
my example was for DFSORT |
|
Back to top |
|
|
cvadlamudi
New User
Joined: 19 Apr 2007 Posts: 68 Location: India
|
|
|
|
expat.. u r rite first 4 bytes contains the RDW so the outrec for VB to VB must be with OUTREC FIELDS=(1:1,4,... )
1:1,4 is the RDW field and continue with your reformat... |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
I want to copy the 10 to 20 bytes of input to output file then how should I specify the OUTREC...?
Is it like OUTREC FIELDS-(1,4,5:10,10)??? |
For a VB file, the RDW is in positions 1-4, so the first data byte starts in position 5. So the tenth data byte starts in position 14. Assuming that's what you want, you would use:
Code: |
OPTION COPY
OUTREC FIELDS=(1,4,14,10)
|
If you want to start with the tenth byte (counting the RDW) you would use 10,10 instead of 14,10. |
|
Back to top |
|
|
mahi
New User
Joined: 04 Apr 2006 Posts: 86 Location: Hyderabad
|
|
|
|
Thank You Frank.... |
|
Back to top |
|
|
|