IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

how to sort variable length records


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
manjinder

New User


Joined: 04 Dec 2005
Posts: 45
Location: pune

PostPosted: Tue Jan 17, 2006 11:51 am
Reply with quote

can anybody tell how to sort variable length record file.
thanx in advance.
regard..
manjinder
Back to top
View user's profile Send private message
nrsmca

New User


Joined: 25 May 2005
Posts: 14

PostPosted: Tue Jan 17, 2006 4:04 pm
Reply with quote

Hi,

Use the following sort fields,

Sort fields = (4+startpos,length,type,a(or)d);

bye.
NRSMCA
Back to top
View user's profile Send private message
gowtham_1982
Warnings : 1

Active User


Joined: 02 Dec 2005
Posts: 109

PostPosted: Tue Jan 17, 2006 4:04 pm
Reply with quote

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
View user's profile Send private message
itssreehere
Warnings : 1

New User


Joined: 10 Jan 2006
Posts: 65
Location: chennai

PostPosted: Tue Jan 17, 2006 4:10 pm
Reply with quote

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
View user's profile Send private message
manjinder

New User


Joined: 04 Dec 2005
Posts: 45
Location: pune

PostPosted: Tue Jan 17, 2006 4:50 pm
Reply with quote

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
View user's profile Send private message
manjinder

New User


Joined: 04 Dec 2005
Posts: 45
Location: pune

PostPosted: Tue Jan 17, 2006 5:06 pm
Reply with quote

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
View user's profile Send private message
manjinder

New User


Joined: 04 Dec 2005
Posts: 45
Location: pune

PostPosted: Tue Jan 17, 2006 5:39 pm
Reply with quote

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
View user's profile Send private message
MichaelKBS

New User


Joined: 10 Jan 2006
Posts: 24
Location: Germany

PostPosted: Tue Jan 17, 2006 7:52 pm
Reply with quote

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
View user's profile Send private message
manjinder

New User


Joined: 04 Dec 2005
Posts: 45
Location: pune

PostPosted: Wed Jan 18, 2006 11:10 am
Reply with quote

thanx micheal OPTION VLSHRT IS WORKING.
THANX ALOTT.
regard..
manjinder
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Store the data for fixed length COBOL Programming 1
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
Search our Forums:

Back to Top