data division help
Posted by admin on 25 Sep 2008 at 08:54 PM
$5.00
Programming Languages / C and C++
Hello, I am attempting to develop a COBOL application (I use Fujitsu Cobol 3.0) on the Windows PC that will read in records from a text file (the text file is actually going to be downloaded via FTP) and manipulate them accordingly. The text file delimits fields by HTML tag. The input records look similar to the following, only much more robust:
<PRESOL>
<NUMBER>999-9999-99
<DATE>01-01-03
<SUBJECT>Hello There
<DATA>yada yada yada... up to 24,000 characters
<DESC>New order
</PRESOL>
I am wondering at the best method to define the records in the data division, and whether COBOL can work with HTML tags as field delimiters. Another problem is, each record can be different -- using the example above, a similar <PRESOL> record might not even have the <DESC> tag. I'm not sure how to handle this (<PRESOL> is one of 9 major template types that I'm working with).
Any suggestions?
<PRESOL>
<NUMBER>999-9999-99
<DATE>01-01-03
<SUBJECT>Hello There
<DATA>yada yada yada... up to 24,000 characters
<DESC>New order
</PRESOL>
I am wondering at the best method to define the records in the data division, and whether COBOL can work with HTML tags as field delimiters. Another problem is, each record can be different -- using the example above, a similar <PRESOL> record might not even have the <DESC> tag. I'm not sure how to handle this (<PRESOL> is one of 9 major template types that I'm working with).
Any suggestions?
Accepted Answer:
| Answer provided by admin on 25 Sep 2008 at 08:54 PM There is no built-in function in COBOL to analyze HTML tags, but there is a fairly easy way to manipulate this kind of data in the code. I would use an UNSTRING statement (with delimiters of < and >) to break the input up into two fields, perhaps HTML-TAG and FIELD-DATA, for example. Then I would use an EVALUATE statement to analyze the HTML-TAG field and proceed accordingly. |
| Rating: * * * * * Awarded: $5.00 |
Ask a Question
Most Recent Questions
Most Recent Answers
Home Page
Login
Register
Information Technology
Programming Languages
- ASP and ASP.NET
- Assembly and Machine Lang
- C and C++
- C#
- Carbon (Macintosh)
- Cold Fusion
- Delphi
- Flash
- FoxPro
- HTML and XHTML
- Java
- Javascript and JScript
- JSP
- Perl
- PHP
- Python
- Ruby on Rails
- VB, VBA, and VB.NET
- VBScript
- XML and XSL
Database
Graphic Design
Operating Platforms
Hardware and Networking
Math and Science
Biology and Geology
Math and Statistics
Chemistry
Physics
Engineering

Are you an information
Most Recent Questions
Most Recent Answers
Home Page
Login
Register
Information Technology
Software, Hardware, Design
Programming Languages- ASP and ASP.NET
- Assembly and Machine Lang
- C and C++
- C#
- Carbon (Macintosh)
- Cold Fusion
- Delphi
- Flash
- FoxPro
- HTML and XHTML
- Java
- Javascript and JScript
- JSP
- Perl
- PHP
- Python
- Ruby on Rails
- VB, VBA, and VB.NET
- VBScript
- XML and XSL
Database
Graphic Design
Operating Platforms
Hardware and Networking
Math and Science
Homework Help
Biology and GeologyMath and Statistics
Chemistry
Physics
Engineering
Are you an information
technology or
math/science expert?
You can earn money by
providing answers to questions
at AnswerArchive.com.
Learn How