Yet another chit chat.

After installing Cobol on the Nslu2 running Debian, still had to load some libraries after and update to Debian. A learning experience.
 One of the test programs I played with to relearn cobol. Cobol is so self documenting.
~$ ./readtest
6543218 Mend ed 1234 1957
1234567 Corona ra 5555 1958
:~$ cat STUDENTS.DAT
6543218Mend ed  195707141234m
1234567Corona ra195806135555f
~$
~$ cat readtest.cob
IDENTIFICATION DIVISION.
PROGRAM-ID.  SeqReadNo88.
AUTHOR.  Michael Coughlan.

ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
    SELECT StudentFile ASSIGN TO "STUDENTS.DAT"
  ORGANIZATION IS LINE SEQUENTIAL.

DATA DIVISION.
FILE SECTION.
FD StudentFile.
01 StudentDetails.
   02  StudentId       PIC 9(7).
   02  StudentName.
       03 Surname      PIC X(8).
       03 Initials     PIC XX.
   02  DateOfBirth.
       03 YOBirth      PIC 9(4).
       03 MOBirth      PIC 9(2).
       03 DOBirth      PIC 9(2).
   02  CourseCode      PIC X(4).
   02  Gender          PIC X.

PROCEDURE DIVISION.
Begin.
   OPEN INPUT StudentFile
   READ StudentFile
      AT END MOVE HIGH-VALUES TO StudentDetails
   END-READ
   PERFORM UNTIL StudentDetails = HIGH-VALUES
      DISPLAY StudentId SPACE StudentName SPACE CourseCode SPACE YOBirth
      READ StudentFile
         AT END MOVE HIGH-VALUES TO StudentDetails
      END-READ
   END-PERFORM
   CLOSE StudentFile
   STOP RUN.
-----------------------------------------
Got some write ups on various sites,;
Hackaday.
Freetronics.
Electronics-lab
Airy08.com
ocotewa01
Free downloads
—————————————————————————–
Solar energy experiment with 1n914 diodes.
Screenshot from 2013-09-26 04:24:04
———————————————————
Experimenta OTA TV antenna. Works pretty good.
Screenshot from 2013-09-24 21:33:07

Comments

Popular posts from this blog

Guiless?

Web.com and Network Solutions, the Walmart of the internet.

MSOffice vs Libreoffice