View previous topic :: View next topic
|
Author |
Message |
prafull
New User
Joined: 08 Dec 2006 Posts: 48
|
|
|
|
Hi
Can ne1 explain, in sorting a VSAM file into a VB length flat file,
position we give in SORT FIELDS is actual or it's POSition+4 ?
why?
e.g.
I want to sort VSAM file using it's first 8 bytes, into a new VBL flat file,
wat shud the values in SORT FILEDS ?
SORT FIELDS=(1,8,CH,A)
or
SORT FIELDS=(5,8,CH,A)
Pls justify.. |
|
Back to top |
|
|
priyesh.agrawal
Senior Member
Joined: 28 Mar 2005 Posts: 1448 Location: Chicago, IL
|
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
prafull,
Priyesh gave the correct DFSORT reference.
To answer your question more directly, for the situation you describe, you would use:
Code: |
RECORD TYPE=V
SORT FIELDS=(5,8,CH,A)
|
|
|
Back to top |
|
|
prafull
New User
Joined: 08 Dec 2006 Posts: 48
|
|
|
|
I dont see any use of RECORD TYPE=..
the result is same .. u provided RECORD TYPE or not.. wat matters is the position ..+4 |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
the result is same .. u provided RECORD TYPE or not |
Not necessarily. It may be true in your case because of the way your job is coded (for example, if you specified RECFM=VB for SORTOUT), but you didn't show your complete job, so I gave you control statements that would assure your job worked correctly.
If you don't specify RECORD TYPE=V for a VSAM input file, then DFSORT uses a default record type of F or V depending on several factors as described here under TYPE:
publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA20/3.15?DT=20060615185603
So without RECORD TYPE=V, you may get the correct record type of V by default or you may not as indicated. With RECORD TYPE=V, you will always get the correct record type of V. And yes, with a record type of V, DFSORT prepends an RDW in positions 1-4, so the first data byte starts in position 5 which translates to adding +4 to the data position. |
|
Back to top |
|
|
prafull
New User
Joined: 08 Dec 2006 Posts: 48
|
|
|
|
Yes, u r right..
This part skipped from my mind..
Thanks for the info Frank Yaeger! |
|
Back to top |
|
|
|