Page 1 of 1

Converting FB file to VB

PostPosted: Thu Mar 11, 2010 11:48 am
by manjeera.bonakurthi
How to convert an FB file to VB

I have 2 i/p files which are in VB
I have to compare these two files for a perticular field and if match occures , I have to write to o/p file .
I have tried using SORT join with reformat fields bt am unable to create the o/p file in VB.

File 1

trans-idA   Trans-idB
1-----4       5------8---------------------------80

1234          4567
2345          6789
3456          9123

File B
                                Trans-id
1---------------------------   17----20------------------------------4096
                                1234
                                3456


O/P FILE

File C
                               Trans-id
1----------------------------17------20----------------------------4096
                               4567
                               9123


I have used the below SORT join keys syntax

JOINKEYS FILES=F1,FIELDS=(9,4,A)
JOINKEYS FILES=F2,FIELDS=(21,4,A)
REFORMAT FIELDS=(F2:5,16,F1:9,4,F2:25,4072)
SORT FIELDS=COPY

As the i/p files are in VB I have added 4 bytes .

Bt when am using the above sysntax am unable to give the VB o/p file format ....
How can indicate the o/p file as VB in Reformat fields?

Re: Converting FB file to VB

PostPosted: Fri Mar 12, 2010 12:08 am
by Frank Yaeger
Which Sort product are you using (DFSORT? Syncsort?).

Re: Converting FB file to VB

PostPosted: Fri Mar 12, 2010 9:32 am
by manjeera.bonakurthi
I t is simple DFSORT

Re: Converting FB file to VB

PostPosted: Fri Mar 12, 2010 10:22 pm
by Frank Yaeger
How can indicate the o/p file as VB in Reformat fields?


By specifying the RDW and a starting position without a length. For example:

   REFORMAT FIELDS=(F2:1,16,F1:9,4,F2:25)

Re: Converting FB file to VB

PostPosted: Tue Mar 23, 2010 4:14 pm
by manjeera.bonakurthi
Thank u for ur solution bt if am mentioning the o/p file RECFM as VB it is giving an error

Re: Converting FB file to VB

PostPosted: Tue Mar 23, 2010 10:14 pm
by Frank Yaeger
Thank u for ur solution bt if am mentioning the o/p file RECFM as VB it is giving an error


I don't know if you used my REFORMAT statement, your incorrect REFORMAT statement or some other REFORMAT statement.
I don't know what error you're getting.

You need to show the job you're using and the messages you received before I can help you.

Also, tell me the RECFM and LRECL of the input file and expected output file.