Solved

Cobol file

Posted on 2002-03-28
8
289 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
  • 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
 
LVL 24

Expert Comment

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

Done?
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 

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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
WMI, model #, retrieving information 10 94
mapAB Challlenge 35 89
Path of Workbook 3 45
advertisement module in core php 4 94
Purpose To explain how to place a textual stamp on a PDF document.  This is commonly referred to as an annotation, or possibly a watermark, but a watermark is generally different in that it is somewhat translucent.  Watermark’s may be text or graph…
A short article about a problem I had getting the GPS LocationListener working.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

747 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now