|
Posted in Computers & Tech / Programming / Programming General
Author: vicky99 Total-Replies: 18 Dear Friends A few days back I was looking for a COBOL compiler. Therefore I made a post here assuming that some might come to my rescue. A few help did come but wasn’t very satisfying. Eventually I found the compiler I was looking for. My compiler is Micro Focus COBOL COMPILER 2.4.12. It runs smoothly under Windows 98, Windows XP and Windows 2003 (I have personally tested it on these operating systems). When I turned to this forum for help regarding COBOL I was surprised to see that there was not even one topic written about COBOL. So I decided to write something about COBOL (though I have been learning COBOL for merely two three days). COBOL is a programming language designed for solving business problems. COBOL though solves a lot more than just business problems and can be used as a solution to many data processing problems. COBOL excels in accounting systems and related activities such as inventory control, retail sales tracking, contact management, commissions, payroll etc etc. It is like English and easy to read. This is why people with little programming knowledge tend to favor it. COBOL professionals got a real boost when Y2K problem surfaced. In old COBOL dealing with date math is even more complicated. Dates in COBOL are typically stored in three different locations (a month, a day, and a year). The year is often stored as 2 digits to save space and simplify output problems with pre-printed forms. In some cases, COBOL programs were written with 4 digit dates and 1900 is subtracted from the date to generate the form (1981 - 1900 = 81) so that the form can look like 1981 when it is generated. This will cause a problem since 2001 - 1900 = 101 instead of 01. In other cases where a 6 digit date was used, the problem is even worse since there is no clear indication of which date we are talking with. Imagine COBOL program that deals with county records to record births and deaths. If all the dates are stored as 6 digits soon you will have records which say something like 08/04/54. Let us suppose, a man live to be a hundred years old, his date of birth is recorded as 08/04/54 and if he dies on his birthday 100 years later his death would also be 08/04/54. A casual observer might interpret this as him dying at birth or who knows what. The situation is not limited to COBOL programs, but because COBOL has been the language of fondness for business applications for so long, there are vastly more COBOL programs in existence. The importance of the year 2000 catastrophe has caused knowledgeable software experts to forecast horrible consequences. It is estimated that the cost of fixing the crisis will run into the billions of dollars. The demand for COBOL programmers increases more or less weekly, as more and more companies understand the scope of the year 2000 problem and begin to apportion resources for its solution. COBOL stands for Common Business Oriented Language. COBOL was developed by the Conference on Data Systems Languages (CODASYL), convened in 1959 by the Department of Defense. COBOL compilers were available in 1960. The American National Standards Institute (ANSI) standardized a version of COBOL in 1968. The language was revised and updated by ANSI in 1974 and again in 1985. These standards sometimes are called COBOL or COBOL-68, COBOL-74, or COBOL-85. Most compilers are now COBOL-85 standard. Some of the advantages of COBOL are that it caters well for business needs and is easily portable to different operating systems or platforms. However, the language is considered to be rather wordy with an overly rigid format. A further disadvantage is that COBOL lacks many of the programming instructions required by the scientific community. Let’s write our first COBOL program. As you might have started learning many languages by printing “HELLO WORLD” in the screen, this is no exception. We shall write a program which would print “HELLO WORLD”. Type the following codes in any text editor, say for example NOTEPAD. 000100 IDENTIFICATION DIVISION. 000200 PROGRAM-ID. HELLO. 000300 ENVIRONMENT DIVISION. 000400 DATA DIVISION. 000500 PROCEDURE DIVISION. 000600 000700 PROGRAM-BEGIN. 000800 DISPLAY "HELLO WORLD". 000900 001000 PROGRAM-DONE. 001100 STOP RUN. Save the file. Name the file HELLO.COB. Select “ALLFILES” in Save as type Field. I am assuming that you have Micro Focus Compiler, though the process is similar in all compilers. Create the Directory Called cob1 in C Drive (As I have done) and place the hello.cob file in that directory. Now run the COBOL compiler. It is usually done by changing directory. C:\>cd cobol C:\Cobol> Now give COBOL command and as the following. C:\Cobol>cobol Microsoft COBOL Compiler Version 2.20 ©Copyright Microsoft Corp. 1982-87 Source filename [.COB]: c:\cob1\hello.cob Object filename [HELLO.INT]: c:\cob1\hello.int Listing filename [NUL.LST]: c:\cob1\hello.lst ** Scanning Environment Division... ** Scanning Data Division... ** Compiling Procedure Division... ** Generating Object Code... No errors or warnings Data area size = 232 Code area size = 38 Now Run the program using “runcob” command C:\Cobol>runcob c:\cob1\hello It will produce the following output HELLO WORLD. I hope you would like this article. If anybody is interested to learn COBOL please write to me and if some one is an expert please do help me in learning COBOL. Thank you all for your time. Bye..
Sat Jul 8, 2006
Reply New Discussion
Posted in Computers & Tech / How-To's and Tutorials / Programming / .NET (VB, C# & J#)
Author: abdo Total-Replies: 3 QUOTEHi, Friends,Welcome to Visual Basic tutorial! You have come to the right place to learn Visual Basic Programming. I like to share the knowledge with you because I have intense passion on Visual Basic. I wish you could spend some time reading the tutorial so that you can really acquire the basic skills in Visual Basic programming. Happy Learning! 1.1 What is computer programming? Before we begin, let us understand some basic concepts of programming. According to Webopedia, a computer program is an organized list of instructions that, when executed, causes the computer to behave in a predetermined manner. Without programs, computers are useless. Therefore, programming means designing or creating a set of instructions to ask the computer to carry out certain jobs which normally are very much faster than human beings can do. In order to do programming, we need to use certain computer language to communicate with the computer. There are many computer languages out there, some of the examples are Visual Basic, Fortran, Cobol, Java, C++, Turbo Pascal, Assembly language and etc. Among them, I pick Visual Basic because it is the easiest to learn as it uses a language very similar to human language. It involves using words such as If, Then, Else, Goto, Select and so on, so it is very fast for any beginner to pick the language. 1.1 What is Visual Basic ? VISUAL BASIC is a high level programming language evolved from the earlier DOS version called BASIC. BASIC means Beginners' All-purpose Symbolic Instruction Code. It is a very easy programming language to learn. The codes look a lot like English Language. Different software companies produced different version of BASIC, such as Microsoft QBASIC, QUICKBASIC, GWBASIC ,IBM BASICA and so on. However, it seems people only use Microsoft Visual Basic today, as it is a well developed programming language and supporting resources are available everywhere. With Visual Basic, you can program practically everything depending on your objective. For example, you can program educational software to teach science , mathematics, language, history , geography and so on. You can also program financial and accounting software to make you a more efficient accountant or financial controller. For those of you who like games, you can program that as well. Indeed, there is no limit to what you can program! There are many such program in this tutorial, so you must spend more time on the tutorial in order to benefit the most. VISUAL BASIC is a VISUAL and events driven Programming Language. These are the main divergence from the old BASIC. In BASIC, programming is done in a text-only environment and the program is executed sequentially. In VISUAL BASIC, programming is done in a graphical environment. Because users may click on a certain object randomly, so each object has to be programmed independently to be able to response to those actions (events). Therefore, a VISUAL BASIC Program is made up of many subprograms, each has its own program codes, and each can be executed independently and at the same time each can be linked together in one way or another. 1.2 The Visual Basic Environment Before you can program in Visual Basic, you need to install VB6 in your computer. If you do not own VB6 yet , you can purchase it from Amazon.com by clicking the link below: Microsoft Visual Basic 6.0 Professional Basically any present computer systems should be able to run the program, be it a Intel Pentium II, Intel Pentium III, Intel Pentium IV or even AMD machines, VB6 can run without any problem. It may not be true for VB2005, older machines might not be able to run VB2005 as it take up much more resources, therefore I still prefer using VB6 as it is light and easy to program. It is still very useful and powerful, and I am happy to know that Microsoft Windows Vista can support VB6. On start up, Visual Basic 6.0 will display the following dialog box as shown in figure 1.1. You can choose to either start a new project, open an existing project or select a list of recently opened programs. A project is a collection of files that make up your application. There are various types of applications we could create, however, we shall concentrate on creating Standard EXE programs (EXE means executable program). Now, click on the Standard EXE icon to go into the actual VB programming environment. Figure 1.1 The Visual Basic Start-up Dialog Box
Wed Apr 2, 2008
Reply New Discussion
Posted in Computers & Tech / Programming / Programming General
Author: FirefoxRocks Total-Replies: 13 I would like to say here that although programs can be interpreted (e.g. PHP) or compiled (e.g. Java, C), markup languages such as HTML, XML cannot be considered programming languages, as they do not enable one to write an algorithm in order to perform calculations or do anything. Rather, HTML describes the structure of web pages (and XML similarly with documents). Personally I prefer JavaScript and PHP, as they are more prominent in web-based applications, however in high school we used Java in grade 11 and C in grade 12. In University the introduction to programming course teaches Java, however I've heard that other programming courses use C. Both of them I am comfortable with. Of course I've heard of things like BASIC, C++, C#, etc., but I've never really investigated or used them.
Wed Oct 26, 2011
Reply New Discussion
Posted in Computers & Tech / Programming / Programming General / C, C++ & Visual C++
Author: Entheone Total-Replies: 13 Well, there are really no global standards when it comes to first-year programming languages, but here in Egypt C and PASCAL are the two programming language course that first-year engineering students take. I'm not sure why they teach PASCAL here, but from what I gather it's because of its less wordy syntax and of its popularity in the past. C, on the other hand, is very effective for two main reasons. Firstly, if taught right, it can give a student a rather comprehensive understanding of the programming methodology in general (except for Object-Oriented Programming, of course). The second reason is that it's as close to a low-level language as you can get without actually being low-level. It has enough options for you to fine-tune your control over every aspect of your software, with the added option of directly embedding Assembly Code right into it for even finer tuning. But its power and versatility is actually the very thing that makes C a rather hard language to begin with. I never really fully appreciated how powerful this language was until I read Bruce Eckel's Thinking in C, which I believe is an amazing book that virtually restructures your mind to be, if you will, One with the C! ;-) If there's any tip I could give you in your first weeks, it's this: don't give up too quickly. Introduction to new concepts in C can get pretty intense at times. If there's something you don't fully understand, don't shrug it off. Stay with it till you feel comfortable enough with it. After you learn the language itself, and if you're still interested in developing your skills in it, then I think you should definitely give Bruce Eckel's book a shot. It'll transform you from a Master to an all-out Wizard.
Mon Oct 6, 2008
Reply New Discussion
Posted in Computers & Tech / Programming
Author: QBRADQ Total-Replies: 22 QUOTE (rapco)Well i inssist.. C is the best language.. why???Beacuse of the number of aplication made to "translate" it into another language.. for example, i have a texas calculator, i can write my program in c and convert it into asm... Same with my pic and motrola microcontrollers, i can write the program in c and have it transalated to asm....
[post="47943"]<{POST_SNAPBACK}>[/post]
Yea, those programs that "translate" it to ASM, they're called "Compilers". Again, this is why I recomend books to anyone that is learning C/C++. In the introduction to nearly every book on the subject, they explain what the compiler does, what the linker does, ect. ect. This is something every programmer should know. Anyway, back to the topic at hand. COBOL is indeed still widely used, particularly on custom-made UNIX mainframes. Heck, there's even an episode of Dilbert about thier mainframe and it's COBOL programming. However, most of the jobs dealing with those large COBOL code bases are already taken. Beyond that, the mainframes are being slowly but surely replaced. I would recomend that you get very good at C++. Explore all the possibilites of classes and templates. Learn as many data orgonization techniques as you can, such as linked lists, binary search trees, hierarcial object node systems and the like. Suplement that with learning new languages just for the fun of it. For example, pick up Python, even if you only use it for a week. Already done Python? OK, go with Pearl. Heck, just Google around and try to find some obscure language that on one uses, and use it for a week. The point I am trying to make here is that languages change at a rapid pace. The key to being a good programmer isn't knowing every language under the sun, it's simply to be a good programmer. Once you can code circles around your friends in any language, you'll be able to do the same in every language. Good luck! QBRADQ
Fri Aug 12, 2005
Reply New Discussion
|