Page 3 of 3

Re: Merging two VB files to VB file

PostPosted: Fri Nov 02, 2012 12:54 pm
by porwalrox
Thanks to all of you!
My problem has been solved. But i am not much very sure, How i stuck with the previous code. Why If i write REFORMAT fields like previous post, it chnges to TYPE=V file to TYPE=F.

I changed my code like:
REFORMAT FIELDS=(F1:1,76,F2:1)
JOIN UNPAIRED,F1,F2           
OPTION COPY                   
OUTFIL FNAMES=OUT,BUILD=(1,4,5)


it is working fine. No problem. But i don't understand. if i code
REFORMAT FIELDS=(F1:1,76,F2:1)         
JOIN UNPAIRED,F1,F2                   
OPTION COPY                           
OUTFIL FNAMES=OUT,BUILD=(1,4,5,76,5,76)

OR
How does a TYPE=V file change to a TYPE=F? Some questions remain unanswered in mind.

Re: Merging two VB files to VB file

PostPosted: Fri Nov 02, 2012 1:10 pm
by BillyBoyo
Did you look at TYPE=V/F in the manual? If so, what do you think is the relevance here?

The JOINKEYS can use any combination of datasets which DFSORT can process. If we stick to QSAM, then it means both fixed-length records, both variable-length or one of each in either order.

The REFORMAT record does not have to be variable. You can make a fixed-length REFORMAT record even if both input files are variable-length records.

What tells DFSORT that the record is variable-length is the RDW. If you want a variable-length REFORMAT you need an RDW from one of the input files.

If you do not put the RDW in the first position of the REFORMAT record, the REFORMAT record will be fixed in length.

If you want variable-length records from fixed-length, there is FTOV/CONVERT available on OUTFIL.

Re: Merging two VB files to VB file

PostPosted: Fri Nov 02, 2012 3:28 pm
by porwalrox
Thanks Billy! I got it that there must be an RDW from any of the input files.

Can you just tell me that if write REFORMAT FIELDS=(F1:1,80,F2:5,76)? it converts a V to F.
If i write REFORMAT FIELDS=(F1:1,80,F2:5). It works fine. How?
Or
If i write REFORMAT FIELDS=(F1:1,80,F2:1). It works fine & If i write REFORMAT FIELDS=(F1:1,80,F2:1,80). Again it coverts a V to F. How does it happen? Could you please explain?

Re: Merging two VB files to VB file

PostPosted: Fri Nov 02, 2012 6:55 pm
by BillyBoyo
:-)

I've been so absorbed in you not specifying 1,4 seperately, it just passed me by that you didn't have a variable record on the REFORMAT. In addition to starting with the RDW, you need, as the last fields, and as you have discovered, something that is actually variable on the REFORMAT record.

One gives you variable, because the REFORMAT definition is variable, the other gives you fixed, because the definition is fixed. If the REFORMAT is variable, you need the RDW, but having and RDW will not make it variable.