Merging two VB files to VB file



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Merging two VB files to VB file

Postby porwalrox » Wed Oct 31, 2012 5:44 pm

Hi,
I have a problem with merging two input VB files & then writing it to another VB file. If I send the output to the SORTOUT DD SYSOUT=*. It works fine.
When I send it to a VB file. It gives error:
ICE043A 9 INVALID DATA SET ATTRIBUTES: OUT RECFM - REASON CODE IS 14

//STEP EXEC PGM=SORT                                     
//SYSOUT DD SYSOUT=*                                     
//IN1 DD DSN=U299060.JN2FL1.PS,DISP=SHR                   
//IN2 DD DSN=U299060.JN2FL2.PS,DISP=SHR                   
//OUT DD DSN=U299060.JN2FLOUT.PS,DISP=SHR               
//SYSIN DD *                                             
 JOINKEYS F1=IN1,FIELDS=(1,7,A)                           
 JOINKEYS F2=IN2,FIELDS=(1,7,A)                           
 REFORMAT FIELDS=(F1:1,80,F2:1,80)                       
 JOIN UNPAIRED,F1,F2                                     
 OPTION COPY                         
 OUTFIL FNAMES=OUT,BUILD=(1,80,11,80)
/*                                   

Here JN2FL1 & JN2FL2 are of type VB.
porwalrox
 
Posts: 38
Joined: Fri Oct 05, 2012 4:05 pm
Has thanked: 2 times
Been thanked: 0 time

Re: Merging two VB files to VB file

Postby BillyBoyo » Wed Oct 31, 2012 5:56 pm

Yet you are telling the REFORMAT record and the OUTFIL that you have F-type files.

A V always needs the RDW.

So, your FIELDS need to have 4 added to their start position.

Your REFORMAT needs to start with F1:1,4 and the other fields changed appropriately..

Your BUILD needs to start with 1,4 and the other fields changed appropriately.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Merging two VB files to VB file

Postby porwalrox » Wed Oct 31, 2012 6:22 pm

Hi Billy!
I know that VB file have first 4 byte as Record Descriptor Word. So that will contain the length of the data. I have F1 & F2 of 80 bytes and JN2FLOUT is of 164 bytes.
So do i need to change my REFORMAT as REFORMAT FIELDS=(F1:1,4) & similarly for BUILD?
porwalrox
 
Posts: 38
Joined: Fri Oct 05, 2012 4:05 pm
Has thanked: 2 times
Been thanked: 0 time

Re: Merging two VB files to VB file

Postby BillyBoyo » Wed Oct 31, 2012 6:35 pm

The keys for your JOIN include the RDW. Is that intended?

What happens with your BUILD if you have an unmatched on F1?

What is 11,80 about?

You now say you have 164, but why? 80+80 is 160.

Even though 1,80 includes the RDW, I think it is bad practice to do it that way.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Merging two VB files to VB file

Postby porwalrox » Wed Oct 31, 2012 6:49 pm

Yes! i am joining those according to the keys available on 1-7 position.
Okay so file with 80 bytes also contains hidden first 4 bytes as RDW. After that it contains data.
Just i tried with 164 bytes, when 160 didn't work.
porwalrox
 
Posts: 38
Joined: Fri Oct 05, 2012 4:05 pm
Has thanked: 2 times
Been thanked: 0 time

Re: Merging two VB files to VB file

Postby porwalrox » Wed Oct 31, 2012 6:55 pm

When i remove OUTFIL statement, OUT DD DSN.... & Build also. Then it gives exact output. First 4 bytes as blank then data from both files.
Something i am doing wrong with REFORMAT & BUILD. Could you please tell me that where i have made the mistake?
porwalrox
 
Posts: 38
Joined: Fri Oct 05, 2012 4:05 pm
Has thanked: 2 times
Been thanked: 0 time

Re: Merging two VB files to VB file

Postby BillyBoyo » Wed Oct 31, 2012 8:01 pm

Can you explain what you are trying to do, show sample input and expected output.

You have three situations, matched, unmatched with record on F1, and unmatched with record on F2. What do you expect for each of those?
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Merging two VB files to VB file

Postby porwalrox » Wed Oct 31, 2012 8:19 pm

Hi billy! problem is not with the output. I know the situation, How JOIN UNPAIRED,F1,F2 is working? But I haven't work with VB files. I am facing this problem when i work with VB file. It also works fine with FB files.
Ex like:
Input1:
a1
b2
input2:
a1
c5

expected output:
a1...........of input1 + a1.........of input2
b2............of input1+ blanks from input2
blanks from input2 + c5.....from input2
porwalrox
 
Posts: 38
Joined: Fri Oct 05, 2012 4:05 pm
Has thanked: 2 times
Been thanked: 0 time

Re: Merging two VB files to VB file

Postby BillyBoyo » Wed Oct 31, 2012 9:22 pm

Have a look at the dataset that is on your OUT DD. It's RECFM is F, isn't it?
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Merging two VB files to VB file

Postby porwalrox » Wed Oct 31, 2012 10:14 pm

No it is not. it is V.
porwalrox
 
Posts: 38
Joined: Fri Oct 05, 2012 4:05 pm
Has thanked: 2 times
Been thanked: 0 time

Next

Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post