Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Creating tab delimited files
I need a little help with imports and exports programs. I have created
many comma delimited programs, I am having an issue with tab delimited
files and numeric fields. I have written an export program that
creates a tab delimited file from an indexed file. I have also written
an import that would use the tab delimited file and update or create
an index field. I am having an issue with numeric fields. Does anyone
have any good examples of these. I am using Acucobol in a Solaris
environment. Thank you


Report this thread to moderator Post Follow-up to this message
Old Post
jmoore207@gmail.com
02-21-07 11:55 PM


Re: Creating tab delimited files
jmoore207@gmail.com wrote:
> I need a little help with imports and exports programs. I have created
> many comma delimited programs, I am having an issue with tab delimited
> files and numeric fields. I have written an export program that
> creates a tab delimited file from an indexed file. I have also written
> an import that would use the tab delimited file and update or create
> an index field. I am having an issue with numeric fields. Does anyone
> have any good examples of these. I am using Acucobol in a Solaris
> environment. Thank you

What kind of problem?

Wouldn't you:
1. Move the numeric value to an editted field
2. STRING value1 TAB value2 TAB... DELIMITED SIZE INTO
OUTPUT-REC
3. Write OUTPUT-REC





Report this thread to moderator Post Follow-up to this message
Old Post
HeyBub
02-21-07 11:55 PM


Re: Creating tab delimited files
In the Olden Days, there may have been a reason for using such
delimited files.
Why bother? Just make it fixed-field format and save yourself the
headaches.
Surely, you cannot have a space or speed problem.

tony dilworth


Report this thread to moderator Post Follow-up to this message
Old Post
foodman
02-21-07 11:55 PM


Re: Creating tab delimited files
jmoore207@gmail.com wrote:
> I need a little help with imports and exports programs. I have created
> many comma delimited programs, I am having an issue with tab delimited
> files and numeric fields. I have written an export program that
> creates a tab delimited file from an indexed file. I have also written
> an import that would use the tab delimited file and update or create
> an index field. I am having an issue with numeric fields. Does anyone
> have any good examples of these. I am using Acucobol in a Solaris
> environment. Thank you
>

I'd advise putting quotes around each field before stringing with tabs.
If you do not, then tabs inside fields will screw up, as well as certain
dates.

Report this thread to moderator Post Follow-up to this message
Old Post
Donald Tees
02-21-07 11:55 PM


Re: Creating tab delimited files
On 21 Feb 2007 06:55:36 -0800, "foodman" <foodman123@aol.com> wrote:

>In the Olden Days, there may have been a reason for using such
>delimited files.
>Why bother? Just make it fixed-field format and save yourself the
>headaches.
>Surely, you cannot have a space or speed problem.

I create files that are downloaded to PCs and are read into Excel.

Until this w, I was unaware that I should have created them as .CSV
file, making it easier to load.   (I created them as .txt files)

Report this thread to moderator Post Follow-up to this message
Old Post
Howard Brazee
02-21-07 11:55 PM


Re: Creating tab delimited files
On Thu, 22 Feb 2007 10:34:07 +1300, "Pete Dashwood"
<dashwood@removethis.enternet.co.nz> wrote:
 
>On Planet Dilworth the villagers know that their COBOL lord has provided th
e
>one true path for them.

The rest of your fun post clipped.

I see a real life compromise - the CoBOL passing fixed field format
XML data to a compressor routine.   This would be easy in an OO
environment, but sufficiently complex in my environment that I created
a CoBOL paragraph(s) that I clone as needed.

Report this thread to moderator Post Follow-up to this message
Old Post
Howard Brazee
02-21-07 11:55 PM


Re: Creating tab delimited files
"Howard Brazee" <howard@brazee.net> wrote in message
 news:ogfpt2t8ufber5hakc4bjt7l3u94nivfa5@
4ax.com...
> On Thu, 22 Feb 2007 10:34:07 +1300, "Pete Dashwood"
> <dashwood@removethis.enternet.co.nz> wrote:
> 
>
> The rest of your fun post clipped.
>
> I see a real life compromise - the CoBOL passing fixed field format
> XML data to a compressor routine.   This would be easy in an OO
> environment, but sufficiently complex in my environment that I created
> a CoBOL paragraph(s) that I clone as needed.

Yes, as usual, Howard, you make good sense.

It is pretty trivial to create XML from a COBOL program (assuming you can't
simply plug in an existing XML component as you probably would in an OO
environment).  There has been some discussion on this in the "Bridging the
Gap" topic, where both Richard and I have advocated using a a templated
approach for XML generation.

Of course, XML for the Dilworthians would be like teaching shorthand to an
orang-utan...

Pete.



Report this thread to moderator Post Follow-up to this message
Old Post
Pete Dashwood
02-21-07 11:55 PM


Re: Creating tab delimited files
On 21 Feb, 22:36, "Pete Dashwood" <dashw...@removethis.enternet.co.nz>
wrote:
> "Howard Brazee" <how...@brazee.net> wrote in message
>
>  news:ogfpt2t8ufber5hakc4bjt7l3u94nivfa5@
4ax.com...
>
>
>
>
> 
> 
> 
> 
> 
> 
>
> Yes, as usual, Howard, you make good sense.
>
> It is pretty trivial to create XML from a COBOL program (assuming you can'
t
> simply plug in an existing XML component as you probably would in an OO
> environment).  There has been some discussion on this in the "Bridging the
> Gap" topic, where both Richard and I have advocated using a a templated
> approach for XML generation.
>
> Of course, XML for the Dilworthians would be like teaching shorthand to an
> orang-utan...
>

The Librarian has no need for shorthand (see the Discworld series)
other than the occasional modular bunch of fives.



Report this thread to moderator Post Follow-up to this message
Old Post
Alistair
02-21-07 11:55 PM


Re: Creating tab delimited files
On Feb 22, 11:36 am, "Pete Dashwood"
<dashw...@removethis.enternet.co.nz> wrote:

> Yes, as usual, Howard, you make good sense.
>
> It is pretty trivial to create XML from a COBOL program (assuming you can'
t
> simply plug in an existing XML component as you probably would in an OO
> environment).  There has been some discussion on this in the "Bridging the
> Gap" topic, where both Richard and I have advocated using a a templated
> approach for XML generation.

Guess how I output CSV files

#   template acreport.file for writing file
#
# ----------------------------------------------------------
*CSV
*ADDCR
:header
Content-Type: application/csv; charset=ISO-8859-1;
Content-Disposition: attachment; filename="<!%extract%>";

<head><title><!%extract%></title></head><body><pre>
:glcoderow
"<!%glcode%>","<!%po%>","<!%supplier%>","<!%loc%>","<!%costcent%>",<!
%amount%>,<!%accrue%>,"<!%user%>","<!%date%>","<!%name%>"
:trailer
</pre></body></html>
:end

This one is from a web based system. It get thrown at the browser for
saving on their local machine, or directly into
Excel^H^H^H^H^HOpenOffice.org Calc.

If they want an XML file or HTML, or EDIFAC or TAB separated, just
change the template.



Report this thread to moderator Post Follow-up to this message
Old Post
Richard
02-21-07 11:55 PM


Re: Creating tab delimited files
On Feb 22, 3:04 am, jmoore...@gmail.com wrote:
> I need a little help with imports and exports programs. I have created
> many comma delimited programs, I am having an issue with tab delimited
> files and numeric fields.

What particular 'issues' are you having ? Is it just the wrong value
you are getting or is it a problem that you need to align the
numerics.  Try FUNCTION NUMVAL USING csvfield.

> I have written an export program that
> creates a tab delimited file from an indexed file. I have also written
> an import that would use the tab delimited file and update or create
> an index field. I am having an issue with numeric fields. Does anyone
> have any good examples of these.

What does the 'these' refer to: TAB delimited files or programs that
read them ?

> I am using Acucobol in a Solaris
> environment. Thank you

Thank you for indicating your environment, that saves having to do a
discourse on the problems of TABs with Microfocus.




Report this thread to moderator Post Follow-up to this message
Old Post
Richard
02-21-07 11:55 PM


Sponsored Links




Last Thread Next Thread Next
Pages (2): [1] 2 »
Search this forum -> 
Post New Thread

Cobol archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 08:11 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.