View previous topic :: View next topic
|
Author |
Message |
manjinder
New User
Joined: 04 Dec 2005 Posts: 45 Location: pune
|
|
|
|
can anybody tell how to sort variable length record file.
thanx in advance.
regard..
manjinder |
|
Back to top |
|
|
nrsmca
New User
Joined: 25 May 2005 Posts: 14
|
|
|
|
Hi,
Use the following sort fields,
Sort fields = (4+startpos,length,type,a(or)d);
bye.
NRSMCA |
|
Back to top |
|
|
gowtham_1982 Warnings : 1 Active User
Joined: 02 Dec 2005 Posts: 109
|
|
|
|
manjinder wrote: |
can anybody tell how to sort variable length record file.
thanx in advance.
regard..
manjinder |
hai manjinder,
if you want to sort in COBOL program, you can do it. but as far as i know, all the files should have the same record format.
corrections welcomed...
gowtham |
|
Back to top |
|
|
itssreehere Warnings : 1 New User
Joined: 10 Jan 2006 Posts: 65 Location: chennai
|
|
|
|
You sort variable length records in exactly the same way as fixed length records, the only difference is that the records passed to the sort program have a four byte record length field (the Record Descriptor Word or RDW) at the beginning. The RDW is accessible in DFSORT, so your data will begin in column 5. You will need to add 4 to all starting positions when using variable length datasets. Variable length VSAM records have an RDW added by DFSORT on input, which is then removed before the record is written, so you will need to add 4 to start positions. |
|
Back to top |
|
|
manjinder
New User
Joined: 04 Dec 2005 Posts: 45 Location: pune
|
|
|
|
i have tried by adding 4 with starting position still error is there
like INVALID DATA SET ATTRIBUTES SPECIFIED SORTOUT RECFM
please give me the solution.
thankx in advance
manjinder |
|
Back to top |
|
|
manjinder
New User
Joined: 04 Dec 2005 Posts: 45 Location: pune
|
|
|
|
thanx alottttttt i have got sorting of variable record length records.
we have to add extra 4 bytes to starting position but i have given o/p file
as a VB is this mandotary.
regard..
manjinder |
|
Back to top |
|
|
manjinder
New User
Joined: 04 Dec 2005 Posts: 45 Location: pune
|
|
|
|
if i/p is aaaa
cccc
bbbb
if i give (5,4,ch,a) it is working if i want sorting from 4 thy cha
then what to give i have given (20,4,ch,a) it not working |
|
Back to top |
|
|
MichaelKBS
New User
Joined: 10 Jan 2006 Posts: 24 Location: Germany
|
|
|
|
manjinder wrote: |
if i/p is aaaa
cccc
bbbb
if i give (5,4,ch,a) it is working if i want sorting from 4 thy cha
then what to give i have given (20,4,ch,a) it not working |
Hey manjider,
you probably got an error because some of your records are shorter
than the position you specified in your sort parameters.
To avoid the error message you have to add the following option:
SORT FIELDS=(20,4,CH,A)
OPTION VLSHRT |
|
Back to top |
|
|
manjinder
New User
Joined: 04 Dec 2005 Posts: 45 Location: pune
|
|
|
|
thanx micheal OPTION VLSHRT IS WORKING.
THANX ALOTT.
regard..
manjinder |
|
Back to top |
|
|
|