Page 1 of 1

Convert FB file to CSV

PostPosted: Sun Mar 24, 2013 9:06 am
by prashant4u
Hi,

I have a requirement to convert the FB file into CSV format . I would like to do using easytrive. Could you please help me how to achieve this using easytrive. I don't want to end up with complex logic.

Records format of the file

01  CUSTTEXT-RECORD.
           05  CUSTTEXT-KEY            PIC 9(12).
           05  CUSTTEXT-STATUS         PIC X.
           05  CUSTTEXT-LAST-NAME      PIC X(28).
           05  CUSTTEXT-FIRST-NAME     PIC X(20).
           05  CUSTTEXT-STREET-ADDR-01 PIC X(48).
           05  CUSTTEXT-STREET-ADDR-02 PIC X(48).
           05  CUSTTEXT-CITY           PIC X(16).
           05  CUSTTEXT-STATE          PIC X(2).
           05  CUSTTEXT-POSTAL-CODE    PIC X(12).
           05  FILLER                  PIC X(325).
      *
      ***  CUSTTXB1 - End-of-Copy File - - - - - - - - - - - CUSTTXB1 *
      *****************************************************************
      *


Sample Input

000000000100 Anderson                    Adrian              1113 Peachtree Plaza, Suite 111                                                                 Atlanta         GA26101
000000000200 Brown                       Billie              224 Baker Boulevard                                                                             Baltimore       MD35702
000000000300 Carson                      Cameron             336 Crenshaw Blvd.                                                                              Cupertino       CA96154
000000000400 Davidson                    Dion                448 Main Street                                                                                 Wilmington      DE27323



The output of program should be as shown below


Sample Output

100,,Anderson,Adrian,1113 Peachtree Plaza, Suite 111,,Atlanta,GA,26101
200,,Brown,Billie,224 Baker Boulevard,,Baltimore,MD,35702
300,,Carson,Cameron,336 Crenshaw Blvd.,,Cupertino,CA,96154
400,,Davidson,Dion,448 Main Street,,Wilmington,DE,27323


If any field in the input file is blank then only ,(comma) should come there to represent that field. E.g In above example status and and Addr-02 is blank and hence you can
see additional commas for this field in output . Could you please help me?

Code'd

Re: Convert FB file to CSV

PostPosted: Sun Mar 24, 2013 10:19 am
by enrico-sorichetti
see here
http://www-01.ibm.com/support/docview.w ... g3T7000094" onclick="window.open(this.href);return false;
==> Deconstruct and reconstruct CSV records

for what reason is this topic the exact duplicate of
http://ibmmainframes.com/about60693.html
??? ???

people helping here are the same helping there,
double posting will not get double answers in the same time, or the same answers in half of the time
it will only bother people, and lower Your benevolence factor :evil: