Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Cobol file

Posted on 2002-03-28
8
Medium Priority
?
333 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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

Independent Software Vendors: 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!

Question has a verified solution.

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

This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
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…
Introduction to Processes

636 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