Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

how to sort variable length records

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: how to sort variable length records
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    Post subject:
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    Post subject: Re: how to sort variable length records
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    Post subject:
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    Post subject: prob with variable record sorting
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    Post subject: i got variable sorting
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    Post subject: one prob with variable record sorting
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    Post subject: Re: one prob with variable record sorting
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    Post subject: thanx for sorting
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts Innovations in Your Mainframe Sort Arun Raj PC Guides & IT News 4 Wed Mar 15, 2017 10:38 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts SORT requirement sjiraga COBOL Programming 6 Thu Mar 09, 2017 9:11 pm
No new posts Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us