I'm working on a module that will read a COBOL "copylib" member file. This would contain only "DATA DIVISION" COBOL, but could include multiple "01" level records. The module will then read a data file, and allow you to access the data using the COBOL names, do data processing, write out the data to a different or the same file, etc.
I've got some working code, but I've never done a CPAN-type module before, so it may take some time to figure that out. The module basically will allow you to do stuff like this:
The assumption here is that you are working on a micro, with files in ASCII format. I've included code do deal with signed numerics, but not packed decimal. I could use some assistance modularizing and refactoring, if anyone is interested. If anyone has other suggestions on what the module should do, please reply. Thx... HH Harry$cobolRecs = new COBOLIO::COBOLRecs(); $cobolRecs->CreateRecs("cobol_copy_1.txt"); open(COBOLDATA, "datafile.txt"); while(<COBOLDATA>) { $cobolRecs->ReadRecInto($_, "BIG_COBOL_RECORD_NAME"); if($cobolRecs->{EMPLOYEE_NUMBER} < 5000) { print "Retirement imminent for $cobolRecs->{EMPLOYEE_NAME}\n"; } }
In reply to Re: How do I manipulate COBOL data?
by Anonymous Monk
in thread How do I manipulate COBOL data?
by mAsterdam
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |