Cobol file

Can I use a cobol data file in ASP and view it in Internet Explorer
sofiansafyAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
CJ_SConnect With a Mentor Commented:
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
 
CJ_SCommented:
You can read the COBOl file and write it out using ASP. Sure you can. is that what you want?

CJ
0
 
CJ_SCommented:
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
What Kind of Coding Program is Right for You?

There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.

 
SunBowCommented:
(I prefer .txt files being the ones commonly moved between operating environments, KISS it)

Done?
0
 
sofiansafyAuthor Commented:
Thanks for your help
0
 
CJ_SCommented:
Why not A graded? Just wondering

CJ
0
 
sofiansafyAuthor Commented:
Hi CJ ,really I need to make a (SELECT statment) in the cobol data file ,Is there any way to do this?
0
 
CJ_SCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.