I'm trying to decipher a set of program files I was given to work with. I don't have the original source (as far as I know) or a copy of the executable, merely a set of files I was requested to deal with.

The files came in two directories, 'data' and 'sys'. Opening one of the files from 'sys' in the OpenOffice word processor, I stumbled upon a line which read, in part, 'Pic([[Z*][#*]*])'. {Note: Exact code witheld; it's not mine to disseminate. That's the general pattern the code took, though.} This looks a bit like COBOL to me, although I'm not completely certain about that.

Here are my questions:
1. Am I correct in assuming that command to be COBOL?
2. If I am incorrect, then what other languages use the 'PIC' command? I'll need to look at those to determine what I'm dealing with.

Thank you for your consideration,
-EnderX

Recommended Answers

All 12 Replies

Looks like COBOL. Don't know of any other programming languages that use that key word, but then I don't know them all either. If you have a COBOL program then it should be quite obvious from other syntex -- COBOL programs have a very distinctive grammer.

That's the problem. I'm not sure if what I have is source code or not; that line makes me think it is, but the vast majority of the file weighs in against the sourcecode theory.

What I have is a set of files that have some clear plaintext in them, but also a vast amount of unknown data. Opening it in notepad gives me the little block image of an unprintable character, while opening it in Edit (DOS command line) shows an array of what look like ancient ascii symbols: Club, Diamond, some kind of wierd spikey circle, etc. These symbols apparently bear no relation other than appearance to the unicode symbols of the same type.

The problem is that I don't know how to pluck the plaintext statements from the rest of the file. I'm hoping you're right about it being COBOL; that at least gives me somewhere to look.

Thanks.

appears to be a file format for some COBOL IDE. you might try downloading some of the free cobol editors and see if any of them can read the file.

Any suggestions? The only thing I've found so far is TinyCobol, which I haven't had a chance to set up yet.

Kind of ironic for me: I have a copy of the MicroFocus Cobol compiler available, designed for Windows 95, but it refuses to let me run it on my XP machine. I don't recall the exact error offhand; I'll have to try running it again.

That's the problem. I'm not sure if what I have is source code or not; that line makes me think it is, but the vast majority of the file weighs in against the sourcecode theory.

Why would you think it's source code? You claim most of the file is unreadable. NotePad would open the file and all you would see is code if it was source code, not junk.

not all editors save files as text files -- some, like MS Word, will save internal formatting data which will look like just in Notepad.

not all editors save files as text files -- some, like MS Word, will save internal formatting data which will look like just in Notepad.

True. But if it's not readable by Notepad, it's not source code compilable by a compiler. And MS Word is not an editor, it's a word processor. There's a big difference.

MS Word was only an example. COBOL IDEs can save it however they wish -- but of course plain text would be the most logical.

And there is, of course, the possibility that the OPs file has been corrupt beyond all recognition. That happened a lot in MS-DOS and Win95 operating systems.

Yes, it sounds like COBOL to me. I know COBOL and can help you, if you like.

hmm, Cobol editors are usually rather BASIC (pun intended) and save either as plain text files (so you can easily ftp them to a server for compilation), or into some sort of database repository where the compiler will pull them from.

This looks like some regular expression being passed into something. Is there even a Cobol dialect that allows that?

Most likely it's just a plaintext header to a binary file of some sort, giving a command in some scripting language internal to the application the file is intended for that it can use to perform operations on the data in the file.

Member Avatar for WangVS

The PIC looks like a clause, not a statement or command, and is used in COBOL and certain dialects of BASIC. The use of brackets and wildcards is unfamiliar to me.

I'd say that if you can't read most of the file(s) using a text tool, it may not be source code. Most COBOL source would be stored as readable text. BASIC on PCs always abbreviated the source, replacing keywords with single-byte values, making the source readable only using the corresponding BASIC interpreter.

I work with COBOL and BASIC only on mainframes, and we don't have this kind of problem. It's also very unusual to actually lose source code in a mainframe environment; it takes someone with the IQ of a garden slug to actually delete it, and that's uncommon. PC-based systems have a host of problems pretty much unknown in the mainframe world, including frequent system reloads, reboots, mangled files, etc.

what look like ancient ascii symbols: Club, Diamond, some kind of wierd spikey circle, etc. These symbols apparently bear no relation other than appearance to the unicode symbols of the same type.

APL maybe?

http://en.wikipedia.org/wiki/APL_(programming_language)

That language uses wierd symbols and was for mainframes?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.