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
Manjucan
Posts: 9
Joined: Thu Feb 07, 2019 10:09 pm
Skillset: Jcl
Cobol
Db2
Referer: Friends

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 ?

User avatar
prino
Posts: 641
Joined: Wed Mar 11, 2009 12:22 am
Skillset: PL/I - CICS - DB2 - IDMS - REXX - JCL, most in excess of three decades
Referer: Google
Location: Vilnius, Lithuania
Contact:

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

Robert Sample
Global moderator
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Skillset: Systems programming, SAS, COBOL, CICS, JCL, SMS, VSAM, etc.
Referer: other forum
Location: Dubuque, Iowa, USA

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).


  • Similar Topics
    Replies
    Views
    Last post