Solved

Cobol file

Posted on 2002-03-28
8
321 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 50 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

Transaction Monitoring Vs. Real User Monitoring

Synthetic Transaction Monitoring Vs. Real User Monitoring: When To Use Each Approach? In this article, we will discuss two major monitoring approaches: Synthetic Transaction and Real User Monitoring.

Question has a verified solution.

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

A short article about a problem I had getting the GPS LocationListener working.
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
Simple Linear Regression

705 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