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

Problem in copying variable length record using sort


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
mahi

New User


Joined: 04 Apr 2006
Posts: 86
Location: Hyderabad

PostPosted: Tue Apr 24, 2007 1:22 pm
Reply with quote

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

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Apr 24, 2007 1:30 pm
Reply with quote

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

New User


Joined: 04 Apr 2006
Posts: 86
Location: Hyderabad

PostPosted: Tue Apr 24, 2007 2:10 pm
Reply with quote

thanx...
I will look in to the material ...
Back to top
View user's profile Send private message
mahi

New User


Joined: 04 Apr 2006
Posts: 86
Location: Hyderabad

PostPosted: Tue Apr 24, 2007 2:27 pm
Reply with quote

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

New User


Joined: 19 Apr 2007
Posts: 68
Location: India

PostPosted: Tue Apr 24, 2007 3:05 pm
Reply with quote

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

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Apr 24, 2007 3:16 pm
Reply with quote

Yes, you could copy to an FB file also.

For the VB to VB, OUTFIL OUTREC=(1,4,29,44)
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Apr 24, 2007 3:17 pm
Reply with quote

OUTFIL OUTREC=(1,4,29,44)

The RDW is (1,4

The data being copied is 29,44
Back to top
View user's profile Send private message
mahi

New User


Joined: 04 Apr 2006
Posts: 86
Location: Hyderabad

PostPosted: Tue Apr 24, 2007 3:40 pm
Reply with quote

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

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Apr 24, 2007 3:49 pm
Reply with quote

I would guess that depends one the sort product you are using,
my example was for DFSORT
Back to top
View user's profile Send private message
cvadlamudi

New User


Joined: 19 Apr 2007
Posts: 68
Location: India

PostPosted: Tue Apr 24, 2007 4:44 pm
Reply with quote

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

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Apr 24, 2007 8:38 pm
Reply with quote

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

New User


Joined: 04 Apr 2006
Posts: 86
Location: Hyderabad

PostPosted: Tue Apr 24, 2007 11:25 pm
Reply with quote

Thank You Frank....
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
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
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top