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 *
*****************************************************************
*
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
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
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