Page 1 of 1

How to Export data from MainFrame to CSV

PostPosted: Mon May 12, 2008 7:00 pm
by bhalchandra
Hi,

I am very new in mainframe, can anyone please guide me how to export data from mainframe to CSV file.

Re: How to Export data from MainFrame to CSV

PostPosted: Mon May 12, 2008 9:19 pm
by dick scherrer
Hello bhalchandra and welcome to the forums,

To do what you want, you can STRING the data values separated by some delimiter (comma or tab or . . .) into an output field and write that output. This example uses the tab character (x'05'):
      STRING IDX               X'05'   
             RCD-TYPE          X'05'   
             DAT-TYPE-ALPHA    X'05'   
             DTL-CNT           X'05'   
             PLAN-NAME         X'05'   
             HDR-DATE          X'05'   
             PROV-DISPRO       X'05'   DELIMITED BY ''   
        INTO MY-OUT-REC.                             
  WRITE MY-OUT-REC.                             

Re: How to Export data from MainFrame to CSV

PostPosted: Wed May 14, 2008 7:09 pm
by bhalchandra
It worked but i am not able to get all data in one file.

Its cuts to 65000 and can export more than 65000 even in CSV...

Do anyone knows why i am only getting 65000 records in my output file??

Re: How to Export data from MainFrame to CSV

PostPosted: Wed May 14, 2008 9:22 pm
by dick scherrer
Hello,

What do you mean by "export"? The process should read some input, STRING the desired output fields with delimiters between them, and WRITE a qsam record. I'm not clear about where export comes into the picture.

I have used this approach to create download ("export") files with many million records.

It may help if you post the relevant part of your code.