IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

CSV file , to display numeric data with leading zeroes


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Deepthy Jose P

New User


Joined: 07 Mar 2007
Posts: 40
Location: India

PostPosted: Fri Nov 21, 2014 12:50 pm
Reply with quote

I am creating a CSV file from a mainframe job, and the file contains some numeric data such as client ID which is having leading zeroes in my mainframe PS file. The same value in CSV file also should display the leading zeroes.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Nov 21, 2014 1:26 pm
Reply with quote

Well, that's excellent. Thanks for letting us know. However, this type of thing is probably better for Twitter. Leave this site free for problems that you are having, and put the daily milestones of excitement elsewhere.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Fri Nov 21, 2014 2:39 pm
Reply with quote

the wording could not have been worse ...
the TS probably complains that after

having done some processing
having created a csv dataset
having transferred it to the PC
having opened it with EXCEL

what he thinks should be treated as an ALPHANUMERICS is displayed as a number
( I.E. without leading zeroes )
Back to top
View user's profile Send private message
David Robinson

Active User


Joined: 21 Dec 2011
Posts: 199
Location: UK

PostPosted: Fri Nov 21, 2014 3:29 pm
Reply with quote

If Enrico's assumption as to what the TS wants is correct, then I may have the solution as I had the exact same issue myself a couple of weeks back.

But I'll wait for confirmation from the TS that this is the issue first. As Bill has pointed out, we don't actually know if he even has a problem.
Back to top
View user's profile Send private message
Deepthy Jose P

New User


Joined: 07 Mar 2007
Posts: 40
Location: India

PostPosted: Fri Nov 21, 2014 4:19 pm
Reply with quote

Sorry for the confusion, My requirement is that the CSV file should convert the numeric data as Alphanumeric so that the Leading Zeroes are displayed in specific columns.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Fri Nov 21, 2014 4:35 pm
Reply with quote

tbe CSV file will not convert anything ...
CSV means only Comma Separated Values

what application are You talking about ?

since we spend time trying to help You
GOOD MANNERS dictate that You should spend more of Your time in trying to post a good description of Your requirement
Back to top
View user's profile Send private message
Deepthy Jose P

New User


Joined: 07 Mar 2007
Posts: 40
Location: India

PostPosted: Fri Nov 21, 2014 5:24 pm
Reply with quote

My Mainframe Job is creating a Reprot and i did a File transfer of the report as a CSV file. when i am opening the CSV file i am losing the leading zeroes in certain fields as teh cSV file is treating those fields as numeric and removing teh padded zeroes from left. I want to retain the leading zeroes in my CSV file.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Fri Nov 21, 2014 5:38 pm
Reply with quote

I would suggest that the problem is with microsoft excel or whatever you use to open the csv file with rather than a mainframe related problem.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Nov 21, 2014 6:34 pm
Reply with quote

Look at your file and confirm the leading zeros are there.

Then look at the cell formatting capabilities in Excel. Choose a non-numeric format, or a numeric format which does not suppress leading zeros.
Back to top
View user's profile Send private message
Deepthy Jose P

New User


Joined: 07 Mar 2007
Posts: 40
Location: India

PostPosted: Mon Nov 24, 2014 10:37 am
Reply with quote

Thanks Bill, the PS file created from the program had the leading zeroes. The CSV report is created on a monthly basis and so manually changing the format of the excel column to Text is not feasible. A sort step was added which will add a =" to the front and " to the end of the required columns. i.e EMP_ID column was changed to ="EMP-ID" and the CSV file generated the columns in text format retaining the leading Zeroes.
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Mon Nov 24, 2014 8:19 pm
Reply with quote

Quote:
daily milestones of excitement

I like that. icon_smile.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 4
No new posts Issues Converting From ZD to Signed N... DFSORT/ICETOOL 4
No new posts Store the data for fixed length COBOL Programming 1
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
Search our Forums:

Back to Top