Convert FB file to CSV



Unicenter CA-Easytrieve Plus Report Generator: CA's information retrieval and data management tool

Convert FB file to CSV

Postby prashant4u » Sun Mar 24, 2013 9:06 am

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
prashant4u
 
Posts: 1
Joined: Sun Mar 24, 2013 8:59 am
Has thanked: 0 time
Been thanked: 0 time

Re: Convert FB file to CSV

Postby enrico-sorichetti » Sun Mar 24, 2013 10:19 am

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:
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2994
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times


Return to CA-Easytrieve

 


  • Related topics
    Replies
    Views
    Last post