?
Solved

Cobol file

Posted on 2002-03-28
8
Medium Priority
?
326 Views
Last Modified: 2010-04-17
Can I use a cobol data file in ASP and view it in Internet Explorer
0
Comment
Question by:sofiansafy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 2
8 Comments
 
LVL 22

Expert Comment

by:CJ_S
ID: 6903594
You can read the COBOl file and write it out using ASP. Sure you can. is that what you want?

CJ
0
 
LVL 22

Accepted Solution

by:
CJ_S earned 150 total points
ID: 6903600
It'd be something like

Public Function ReadScript(sFile)
    Set fso = Server.CreateObject("Scripting.FileSystemObject")
    Set txtStream = fso.OpentextFile(sFile, 1, true)
    sScript = txtStream.ReadAll()
    txtStream.Close
    Set txtStream = nothing
    Set fso = nothing
   
    ' ** replace any characters here, like
    sScript = Replace(sScript, "<", "&lt;")
    ReadScript = sScript
End Function

Call it like

<%=ReadScript("c:\myfile.txt")%>
or
<%=ReadScript(Server.MapPath("filefromcuurrentdirectory\myfile.txt")%>

CJ
0
 
LVL 22

Expert Comment

by:CJ_S
ID: 6903603
if you want to run the COBOL program then you cannot from plain ASP. You will need to execute the program serverside and write the output to the screen. Can be done several ways but most involve security issues.

last option is to start using .Net and use the .Net COBOL compiler (which I have no idea from where you can get it).

CJ
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 24

Expert Comment

by:SunBow
ID: 6904087
(I prefer .txt files being the ones commonly moved between operating environments, KISS it)

Done?
0
 

Author Comment

by:sofiansafy
ID: 6912734
Thanks for your help
0
 
LVL 22

Expert Comment

by:CJ_S
ID: 6914017
Why not A graded? Just wondering

CJ
0
 

Author Comment

by:sofiansafy
ID: 6918370
Hi CJ ,really I need to make a (SELECT statment) in the cobol data file ,Is there any way to do this?
0
 
LVL 22

Expert Comment

by:CJ_S
ID: 6936212
That wouldnbe possible if I'd knew what you mean, can you explain? I dislike the B grade though, so I'm not sure yet...

CJ
0

Featured Post

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn different types of Android Layout and some basics of an Android App.
This article will show how Aten was able to supply easy management and control for Artear's video walls and wide range display configurations of their newsroom.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Suggested Courses

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question