MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Text fields in CSV file

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
geetha001
Beginner


Joined: 22 Jun 2005
Posts: 41
Topics: 14

PostPosted: Wed Aug 06, 2008 10:24 am    Post subject: Text fields in CSV file Reply with quote

I have to convert a file to a CSV file using easytrieve.

In order to keep the text fields/aviod zero suppression, I had a to use a special character

For eg: the output fields are defined as

Code:

O-QUOTL1      = '"'               
O-SPCLCHAR  = ''''             
O-NUM1          = IN-NUM
O-QUOTR2      = '"'               
O-COMMA       = ','               

if IN-NUM is equal to 0022424, then this will appear in the excel file as

"'0022424"


IN-NUM comes from the input file and can have values starting with a zero.

My question is how can I use the equal sign and enclose the value in double quotes when the value is taken from an input file (input field) like the way it is mentioned in the following link

http://www.mvsforums.com/helpboards/viewtopic.php?p=41430#41430

Somehow I am not able to correlate the information given in this link with my requirement. Please let me know if you have solution.

I don't think I can rewrite

O-NUM1 = '="IN-NUM"', easytrieve may not recognize this right?

Thanks.
Back to top
View user's profile Send private message
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Wed Aug 06, 2008 12:15 pm    Post subject: Reply with quote

Why not try it?

But why not define IN-NUM as a charcter field and then it would not drop the leading zeros.
_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
Back to top
View user's profile Send private message
geetha001
Beginner


Joined: 22 Jun 2005
Posts: 41
Topics: 14

PostPosted: Wed Aug 06, 2008 2:15 pm    Post subject: Reply with quote

I could have thought better before posting this topic, the answer was right there in Kolusu's email.

I finally tried and it worked. This forum has helped me a lot when I needed.

Thanks
Back to top
View user's profile Send private message
geetha001
Beginner


Joined: 22 Jun 2005
Posts: 41
Topics: 14

PostPosted: Thu Aug 28, 2008 10:12 am    Post subject: Reply with quote

I had to re-open this thread. Because, although I used the solution

Code:

O-QUOTL1      = '='               
O-SPCLCHAR  = '"'             
O-NUM1          = IN-NUM
O-QUOTR2      = '"'               
O-COMMA       = ','               

if IN-NUM is equal to 0022424, then this appears in the excel file as

="0022424"


Although as soon as we see the CSV file, the numeric fields look like text fields, when I click on any cell which then in the column it comes as ="01 " and this requirement is not acceptable to my client. They do not want to see these equal and quote signs, so that they are able to use the normal excel sorting etc.,

Is the only solution to use a quote character infront of the numeric field value or could there be any other solution for this ? Please let me know.
Code:

O-QUOTL1      = '"'               
O-SPCLCHAR  = ''''             
O-NUM1          = IN-NUM
O-QUOTR2      = '"'               
O-COMMA       = ','               

if IN-NUM is equal to 0022424, then this appears in the excel file as

="0022424"


Thanks
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group