home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / alt / cobol / 642 < prev    next >
Encoding:
Internet Message Format  |  1993-01-04  |  1.2 KB

  1. From: Bruce.Feist@f615.n109.z1.fidonet.org (Bruce Feist)
  2. Sender: Uucp@blkcat.UUCP
  3. Path: sparky!uunet!blkcat!Uucp
  4. Newsgroups: alt.cobol
  5. Subject: Re; Why COBOL for the 90's
  6. Message-ID: <726123825.AA00000@blkcat.UUCP>
  7. Date: Sun, 03 Jan 1993 19:58:42 -0500
  8. Lines: 20
  9.  
  10. Hello Drake!
  11.  
  12.  D> I'm just starting out in COBOL; could I have a few
  13.  D> examples where the advantage of COBOL is clearly shown?
  14.  
  15. COBOL is pretty much unsurpassed at describing data (PL/1 does about as well).
  16. I'm not talking user-defined data types or complex structures here; I'm talking
  17. about describing file layouts.  This makes it easy to access data residing in
  18. files, and also simplifies report generation.  To build a line of a report, you
  19. just issue assignment statements filling out the different fields.  In C, in
  20. contrast, the best approach is probably to use a rather complex (due to the need
  21. to align columns) fprintf() call.  And, if any of your data is in a type not
  22. supported by C (for instance, packed decimal), it gets even messier.
  23.  
  24. A related advantage is COBOL's skill at defining the format of data at the field
  25. level.  You can cause commas or other characters to be inserted at appropriate
  26. places, for instance, without doing any special manipulation of the data.
  27.  
  28. Bruce
  29.  
  30.