Retain Leading Zeroes in CSV File exported from mainframe



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

Retain Leading Zeroes in CSV File exported from mainframe

Postby Manjucan » Thu Apr 16, 2020 10:27 pm

Hi ,

There is a requirement to export mainframe file as CSV format file using FTP.

Doing so ,the fields with leading zeroes are displayed without leading zeroes while opening the CSV file.

Any ways to retain the leading zeroes in the fields ?
Manjucan
 
Posts: 9
Joined: Thu Feb 07, 2019 10:09 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Retain Leading Zeroes in CSV File exported from mainfram

Postby prino » Thu Apr 16, 2020 10:43 pm

Manjucan wrote:Doing so ,the fields with leading zeroes are displayed without leading zeroes while opening the CSV file.

Opening it with what?
Robert AH Prins
robert.ah.prins @ the.17+Gb.Google thingy
User avatar
prino
 
Posts: 641
Joined: Wed Mar 11, 2009 12:22 am
Location: Vilnius, Lithuania
Has thanked: 3 times
Been thanked: 29 times

Re: Retain Leading Zeroes in CSV File exported from mainfram

Postby Robert Sample » Thu Apr 16, 2020 10:48 pm

If you are opening the file with Excel (and the critical information about which program you're using to open the file was omitted from your post), then you need to be aware that this is an EXCEL issue and NOT a mainframe issue. By default, Excel will remove leading zeros from numbers in CSV files -- if you want another behavior, I recommend you use Google for "leading zeros in CSV file" and click on some of the links provided (there's about 147,000 so you have plenty of choices).
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post