Alright, I'm stuck. 🙁
I'm reading in a fixed length file that is in COBOL format. Iwas able to read in the file using
$buffer = fread($handle,604);
And then split out the values using
$string1 = substr($buffer, $x,$y);
echo $string1;
For all the strings that are listed in the copy book as
05 R206-TX-HOME-PHN-NO PIC X(8).
Where i am having difficulty is reading the values like
05 R206-AT-CHGOFF PIC S9(7)V9(2) COMP-3.
I'm trying to unpack() the informatio (if that's what I'm supposed to do with it to display it) But I don't think I'm getting the correct results. I'm using
$string1 = unpack("N",substr($buffer, $x,$y));
foreach ($string1 as $v) {
print "$v";
}
Of course the first argument in the unpack function may not work depending on how many bytes I grab. Any thoughts?
Thanks 🙂