I have this file http://pastebin.com/pH4Pk0sf without extension, and it may be COBOL, because the computer it's hosted uses BASIC, COBOL and something called "KEY BASIC"... I don't understand this code... I do with some lines but not all...
I want to convert this to C# but I have no idea about how, if someone can tell me which language is it, maybe I can dig more.
The program reads this other file http://pastebin.com/rdbdappQ and creates an output for printer... I need to know how the hell it works in order to make a Windows program (via C#) to do the same...
Thank you.
UPDATE
Thank for your help, I'm trying to recreate the code, I see things like this OPEN '3/1/TABPRESU' FOR RANDOM IO ELSE DISPLAY 'NO ABRE TABPRESU';STOP I don't know what is "3/1/TABPRESU" of course it is a file, I have "TABPRESU" but what is "3/1" ? is not a FileSystem, because it does not exists, or maybe it is some kind of DataBase ?
The program we're using is SovereignX, under UNIX, it has an option UNIXCOPY which allows user to copy afile from SovereignX to UNIX Filesystem, I haven't found any info about SovereignX...
It would be extremly helpful to find a way to see the source code of everything and recreate it, we do the INPUT under a command called BE (Batch Entry). I'm trying to download whole OS to an USB Drive via FTP (I don't know why the machine wont boot UBUNTU LIVE USB, the motherboard allows you to boot it, but nothng happens so the only option is download via FTP and try to run it under some virtual machine...
http://en.wikipedia.org/wiki/Northgate_Information_Solutions
Northgate Purchased Microdata (creator of SovereignX), then Mcdonell Douglas purchased northgate... This research is killing me... Seems that everything is under some kind of databse, written in DATA/BASIC and PROC
http://timmcnulty.iofm.net/realityx.htm
UPDATE 2 IT IS KEYBASIC LANGUAGE... But it is a bit messy if I open the files with NP++, I need to export from SovereignX then it can be read... But doing that with ~100 files is extreme... Someone knows a KeyBasic IDE? mhh thanks
UPDATE 3 The .DAT and .IDX files this program has, are password protected, from console it doesnt ask me for password but it does if I use DBISAM Viewer, and nobody knows the password... Damn
Definitely a BASIC dialect. Fairly old code, so there's nothing too obscure. An IF ... THEN is an IF ... THEN.
The code between the lines numbered 5 and 90 (lines 10 through 38 in your pastebin) is your main processing loop. The GOSUBs at lines 5000 and 9000 are subroutines called from the main loop.
A couple of the more arcane features that I see here, irrespective of the dialect:
Update
Something I missed on the first reading: the bracket syntax is performing a substring operation. So, for instance, the code at line 12 of your pastebin,
IF R[26,2]='20' THEN GOSUB 9000;GOTO 5
is comparing characters 26 and 27 of the buffer (associated with the READ at line 5) to the string '20'. In the next line, R[26,2]#30, the # is a not-equal-to operator.
Update
I'm with you, not all the formatting strings are explained in the doc. But I suspect that Z, 9, and , work like they do in COBOL.
Z: suppress leading zeroes: print space if the corresponding digit and all digits to the left are zero, the digit
otherwise,: print a comma if there is a nonblank/nonzero digit to the left,
space otherwise9: print the corresponding digit, even if it's zeroSo with a format string of MDZZ,ZZ9:
0 prints as 0
12 prints as 12
123 prints as 123
1234 prints as 1,234
12345 prints as 12,345
Update
The syntax of the OPEN statement in your pastebin does not exactly match the documentation for Caché MultiValue Basic nor for UniBasic. However, I can surmise that part of the string '1/1/FSNC0128S' represents channel number 1, and it's this same channel number that appears in
5 READ R FROM 1 ELSE GOTO 90
Think of a channel number like a filehandle in Perl or a C file descriptor.
I would work under the assumption that the other 1 in the string is some sort of access modifier (although the FOR RANDOM IO would seem to contradict), and just focus on locating the file FSNC0128S.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With