Qur'an – Bible.

* Religion * Politics * News Networks * Mainstream Media Biased Reporting * Independent Analysis

Archive for the ‘Technology’ Category

AS/400 – iSeries Sample COBOL program.

Posted by QB on November 1, 2008

CT wanted COBOL program written for IBM iSeries. The following is simple sample interactive program (online program) adding Customers Information. This program will add customer records and update existing Customers Information.

QB Software Inc.

*USER                                                                         *SYSNAME

*DATE                                                                         *TIME

Customer Number : 1234567890

Enter Customer Number and Press <Enter>

F3= End

When press enter second screen format will be displayed which will allow user to input or update the information.

Company heading constant.
Customer number will be output field on this format.

*USER                                                                         *SYSNAME

*DATE                                                                         *TIMEName : (25) Characters
Address : (25) Characters
City : (20) Characters
State : (2) Characters

Enter Customer Information and Press

F3=End F12=Previous Screen

The formats will be designed using SDA which will generate your DSPF DDS. Condition indicator 30 is used to check the input field. The error message will be displayed “Customer Number be blank.” on line number 24, if user press enter leaving this field blank. The condition indicator 30 will also have the reverse image associated with this field attributes.

Condition indicators with reverse image and position cursor will be associated with all the input fields.

Indicator 33 Customer Name when “ON” will display message “Customer Name cannot be blanks.”

Indicator 34 Customber Address.

Fields User System Name Date and Time will be retrieved from system date and time. User name will be retrieved from Job Attributes.

Indicator 35 Customer City

Indicator 36 Customer State

The messages usually are defined in user message file but it will be easy for beginers to include the error messages on SDA formats.

IDENTIFICATION DIVISION.
       PROGRAM-ID.                     CUSTMAST.
       ENVIRONMENT DIVISION.
       CONFIGURATION SECTION.
       INPUT-OUTPUT SECTION.
       FILE-CONTROL.
            SELECT Customer-FILE ASSIGN TO DISK-Customer
                   ORGANIZATION IS Indexed
                   Access Mode Is Dynamic
                   Record Key Is Cust-No.

              SELECT Screen-File Assign TO WORKSTATION-CUSTFMTS
                   ORGANIZATION IS Transaction.                  

       DATA DIVISION.
       FILE SECTION.
       FD   Cust-FILE
            LABEL RECORDS ARE STANDARD.
       01   Custs-REC.
            Copy DDS-ALL-FORMATS of CUSTOMER.

       FD   SCREEN-FILE
            LABEL RECORDS ARE STANDARD.
       01   SCREEN-REC.
            COPY DDS-ALL-FORMATS OF CUSTFMTS.

       WORKING-STORAGE SECTION.

       77   IND-OFF                       PIC 1  VALUE B"0".
       77   IND-ON                        PIC 1  VALUE B"0".

       01   SCREEN-INDICATORS.
            05 F03-EXIT                   PIC 1.
            05 F12-PRV-SCRN               PIC 1.
            05 CUST-SPACES                PIC 1.
            05 CUST-NAME-SPACES           PIC 1.
            05 CUST-ADDRESS-SPACES        PIC 1.
            05 CUST-CITY-SPACES           PIC 1.
            05 CUST-STATE-SPACES          PIC 1.
            05 CUST-NOT-FOUND             PIC 1.

       PROCEDURE DIVISION.
       MAIN-RTN.
            OPEN I-O    CUSTOMER-FILE
                        SCREEN-FILE.

            PERFORM CUSTOMER-INUT-RTN UNTIL F03-EXIT.     

            CLOSE CUSTOMER-FILE
                  SCREEN-FILE.
            STOP RUN.

       CUSTOMER-INPUT-RTN. 

            WRITE SCREEN-REC  FORMAT IS "CUSTFMT1"
                  INDICATORS ARE SCREEN-INDICATORS.
            READ SCREEN-REC INDICATORS ARE SCREEN-INDICATORS.

            IF CUST-NO   = SPACES
               MOVE  IND-ON     TO CUST-SPACES
               GO TO CUSTOMER-INPUT-RTN.

            PERFORM CHECK-CUSTOMER.
            MOVE ZEROS          TO SCREEN-INDICATORS.
            PERFORM CUSTOMER-DETILAS.
       CUSTOMER-DETAILS.
            WRITE SCREEN-REC  FORMAT IS "CUSTFMT2'
                  INDICATORS ARE SCREEN-INDICATORS.
            READ SCREEN-REC INDICATORS ARE SCREEN-INDICATORS.

            IF CUST-NAME = SPACES
               MOVE IND-ON     TO CUST-NAME-SPACES
               GO TO CUSTOMER-DETAILS.

            IF ADDRESS = SPACES
               MOVE IND-ON TO CUST-ADDRESS-SPACES
               GO TO CUSTOMER-DETAILS.

            IF CITY = SPCACES
               MOVE IND-ON TO CUST-CITY-SPACES
               GO TO CUSTOMER-DETAILS.

            IF STATE = SPACES
               MOVE IND-ON TO CUST-STATE-SPACES
               GO TO CUSTOMER-DETAILS.

            MOVE ZEROS TO SCREEN-INDICATORS.
            IF RECORD-NOT-FOUND
               MOVE CORR CUSTFMT2 TO CUST-REC
               WRITE CUST-REC
            ELSE
               MOVE CORR CUSTFMT2 TO CUST-REC
               REWRITE CUST-REC.

       CHECK-CUSTOMER.
            MOVE IND-OFF      TO CUST-NOT-FOUND.
            READ CUST-FILE INVALID KEY
                MOVE SPACES TO CUST-NAME
                MOVE SPACES TO ADDRESS
                MOVE SPACES TO CITY
                MOVE SPACES TO STATE
                MOVE IND-ON TO CUST-NOT-FOUND
                NOT INVALID KEY
                MOVE IND-OFF TO CUST-NOT-FOUND
                MOVE CORR CUST-REC TO CUSTFMT1.

This is very simple iSeries COBOL program. You have to debug it for errors because
I did not compile and run the program. 

STRDBG CUSTMAST updprod(*yes) will let you debug the source. Compile it with *Source
debug view. Also have not worked on COBOL for many many years and its kind of rusty.
This program written in RPG/ILE will be much simple.
Advertisements

Posted in AS/400, COBOL, iSeries, Software, Technology | 4 Comments »

iSeries – CL program record update.

Posted by QB on June 7, 2008

CL programs can read and update database records as well as read and write formats. CL programs can’t handle large database effectively so it is not good practice to update records from CL programs.

The simple example of CL program record update.

PGM

DCL Var(&FileName) *Char Len(10)

DCL Var(&LibName) *Char Len(10)

ChgVar Var(&FileName) Value(‘AcctPayble’)

ChgVar Var(&LibName) Value(‘Accounts’)

DCLF File(&LibName/&FileName)

Read: RCVF /* Read the first record */

MonMsg MSGID(CPF0864) EXEC(GOTO CMDLBL(EOF))

Process: Do your processing here….. whatever it may be

SndF                                                                               /* Update record after processing */

GoTo Read

EOF: /* End Of File */

EndPgm

Very simple program to update database.

Update : CLLE program did not update keyed database. It works well for SDA formats. Did not try to update sequential file yet.

Posted in CL Programming, iSeries, Technology | 3 Comments »

COBOL – Programs.

Posted by QB on December 8, 2007

The COBOL sample programs did get some hits which means that there are still people who wanted to learn this language. COBOL is the language which has become obsolete but still there are some big corporations systems are written in COBOL.

Did not get the feedback so really don’t know whether these examples are helpful or not. I will be glad to write COBOL sample program for your assignment. All you have to do is to post it in comments. The specifications must be clear, with file layouts, sample data.

Posted in COBOL, Information Technology, Technology | Leave a Comment »

Sample COBOL Program – Indexed File Update.

Posted by QB on November 21, 2007

000010 IDENTIFICATION DIVISION.
000020**********************************************************************************
000030* This program reads Agency file and update records on Accounts *
000040* Index File. There are two types of records on this file.                   *
000050* Deposits and withdrawal. Deposits cannot exceed 30000 and      *
000060* withdrawal must be equal to or less than the deposit amount.       *
000070* Records meeting this criteria will be updated on Account Index     *
000080* file rejecting records which do not meet this criteria.                     *
000090*********************************************************************************
000100 PROGRAM-ID.                    PRFOURC.
000110 AUTHOR.                           QB.
000120 ENVIRONMENT DIVISION.
000130 CONFIGURATION SECTION.
000140 INPUT-OUTPUT SECTION.
000150 FILE-CONTROL.
000160          SELECT AGENCY-FILE ASSIGN TO "AGENCY.DAT"
000170                 ORGANIZATION IS SEQUENTIAL.
000180          SELECT ACCOUNT-INDEXED-FILE ASSIGN TO "ACCOUNTIDX.DAT"
000190                 ORGANIZATION IS INDEXED
000200                 ACCESS MODE IS DYNAMIC
000210                 RECORD KEY IS ACCT-NO.
000220 DATA DIVISION.
000230 FILE SECTION.
000240 FD  AGENCY-FILE.
000250 01  AGENCY-RECORD.
000260      05 RECORD-TYPE             PIC X.
000270      05 ACCOUNT-NO              PIC X(7).
000280      05 AMT                              PIC 9(4)V99.
000290 FD  ACCOUNT-INDEXED-FILE.
000300 01  ACCOUNT-INDEXED-RECORD.
000310      05 ACCT-NO                    PIC X(7).
000320      05 ACCT-NAME               PIC X(15).
000330      05 ACCT-BAL                 PIC 9(4)V99.
000340      05 TOT-DEPOSIT             PIC 9(4)V99.
000350 WORKING-STORAGE SECTION.
000360 77  EOF                               PIC X(3)      VALUE "NO ".
000370 77  RECORD-FOUND           PIC X         VALUE "N".
000380 01  WORKING-FIELDS.
000390      05 AMT-WORK               PIC 9(4)V99.
000400 PROCEDURE DIVISION.
000410 MAIN-RTN.
000420      OPEN INPUT AGENCY-FILE.
000430      OPEN I-O   ACCOUNT-INDEXED-FILE.
000440      PERFORM READ-TRANSACTIONS UNTIL EOF = "YES".
000450
000460      CLOSE AGENCY-FILE
000470            ACCOUNT-INDEXED-FILE.
000480      STOP RUN.
000490 READ-TRANSACTIONS.
000500      READ AGENCY-FILE NEXT RECORD AT END
000510           MOVE "YES"            TO EOF.
000520***********************************************************************************
000530* Set record found indicator ON before reading account index file.    *
000540* Record found indicator will be turned OFF when record not found  *
000550* on account indexed file.                                                                     *
000560***********************************************************************************
000570      MOVE "Y"                   TO RECORD-FOUND.
000580      MOVE ACCOUNT-NO            TO ACCT-NO.
000590      READ ACCOUNT-INDEXED-FILE INVALID KEY
000600           MOVE "N"              TO RECORD-FOUND.
000610
000620      IF EOF NOT = "YES" AND RECORD-FOUND = "Y"
000630         PERFORM CHECK-RECORD-TYPE.
000640 CHECK-RECORD-TYPE.
000650      IF RECORD-TYPE = "L"
000660         PERFORM UPDATE-DEPOSIT
000670      ELSE
000680         PERFORM UPDATE-WITHDRAWAL.
000690 UPDATE-DEPOSIT.
000700********************************************************************
000710* Check the transation amount not exceeding 3000.00   *
000720********************************************************************
000730      COMPUTE ACCT-BAL = ACCT-BAL + AMT.
000740      MOVE ACCT-BAL              TO AMT-WORK.
000750      IF AMT-WORK < 3000.00 OR AMT-WORK = 3000.00
000760         REWRITE ACCOUNT-INDEXED-RECORD INVALID KEY
000770         DISPLAY "ERROR ON REWRITE".
000780 UPDATE-WITHDRAWAL.
000790**************************************************************************************
000800* In withdrawal case only check will be the withdrawal amount is less *
000810* or equal to account balance amount.                                                     *
000820**************************************************************************************
000830      IF AMT < ACCT-BAL OR AMT = ACCT-BAL
000840         COMPUTE ACCT-BAL = ACCT-BAL - AMT
000850         REWRITE ACCOUNT-INDEXED-RECORD INVALID KEY
000860         DISPLAY "ERROR ON REWRITE".
000870 Input File Agency.  L1001000010000
W3167592050000
W2313140035050
L1000001217483
L3234577250000
W2000312190043

Posted in COBOL, Technology | 7 Comments »

Sample COBOL Program – Indexed File Creation.

Posted by QB on November 21, 2007

000010***********************************************************************
000020 IDENTIFICATION DIVISION.
000030 PROGRAM-ID. PRFOURA.
000040 AUTHOR. QB.
000050 DATE-WRITTEN. 10/19/2007.
000060 DATE-COMPILED.
000070
000080 ENVIRONMENT DIVISION.
000090 CONFIGURATION SECTION.
000100 SOURCE-COMPUTER. PC.
000110 OBJECT-COMPUTER. PC.
000120 INPUT-OUTPUT SECTION.
000130 FILE-CONTROL.
000140 SELECT ACCOUNT-FILE ASSIGN TO “A:\ACCOUNT.DAT”
000150 ORGANIZATION IS SEQUENTIAL.
000160
000170
000180 SELECT ACCOUNT-INDEXED-FILE ASSIGN TO “A:\ACCOUNTIDX.DAT”
000190 ORGANIZATION IS INDEXED
000200 ACCESS MODE IS DYNAMIC
000210 RECORD KEY IS ACCT-NO.
000220
000230 DATA DIVISION.
000240 FILE SECTION.
000250 FD ACCOUNT-FILE.
000260 01 ACCOUNT-RECORD.
000270 02 ACCOUNT-NO PIC X(7).
000280 02 ACCOUNT-NAME PIC X(15).
000290 02 ACCOUNT-BAL PIC S9(4)V99.
000300 02 TOTAL-DEPOSIT PIC S9(4)V99.
000310
000320 FD ACCOUNT-INDEXED-FILE.
000330 01 ACCOUNT-INDEXED-RECORD.
000340 02 ACCT-NO PIC X(7).
000350 02 ACCT-NAME PIC X(15).
000360 02 ACCT-BAL PIC S9(4)V99.
000370 02 TOT-DEPOSIT PIC S9(4)V99.
000380
000390 WORKING-STORAGE SECTION.
000400 77 EOF PIC X(3) VALUE “NO “.
000410
000420 PROCEDURE DIVISION.
000430 MAIN-PARAGRAPH.
000440 OPEN INPUT ACCOUNT-FILE.
000450 OPEN I-O ACCOUNT-INDEXED-FILE.
000460
000470 PERFORM READ-ROUTINE UNTIL EOF = “YES”.
000480 CLOSE ACCOUNT-FILE
000490 ACCOUNT-INDEXED-FILE.
000500 STOP RUN.
000510
000520 READ-ROUTINE.
000530 READ ACCOUNT-FILE AT END
000540 MOVE “YES” TO EOF.
000550 IF EOF NOT = “YES”
000560 PERFORM WRITE-RECORD.
000570
000580
000590 WRITE-RECORD.
000600 READ ACCOUNT-INDEXED-FILE INVALID KEY
000610 MOVE ACCOUNT-NO TO ACCT-NO
000620 MOVE ACCOUNT-NAME TO ACCT-NAME
000630 MOVE ACCOUNT-BAL TO ACCT-BAL
000640 MOVE TOTAL-DEPOSIT TO TOT-DEPOSIT
000650 WRITE ACCOUNT-INDEXED-RECORD INVALID KEY
000660 DISPLAY “Error occured writing indexed file”.
000670

The following is the input file ACCOUNT.DAT.

1000001W Sloan        120050000000
1001000R Gillespie    037523030254
2000312J McMordie     173281100012
3167592D Hughes       293553002481
3234577A Thompson     100000100000

Posted in COBOL, Technology | Leave a Comment »

Sample COBOL Progam For Students.

Posted by QB on November 19, 2007

Sample COBOL Program for Students.

The following is the sample program for COBOL students. The COBOL students can use this program as a model to complete their assignments. This is also very important to clearly understand the simple logic of the program. This program will print two reports reading Sales input file. The End Of File indicator is initialized to “NO ” in the working storage section. The Page Size define the number of lines printed on each page, line count will be used to print headings. The totals will be printed after processing all records in Sales File. Students have to align the report columns, also may have to change some of the code according to their editor requirement.

IDENTIFICATION DIVISION.
       PROGRAM-ID.                     SALESRPT.
       ENVIRONMENT DIVISION.
       CONFIGURATION SECTION.
       INPUT-OUTPUT SECTION.
       FILE-CONTROL.
            SELECT SALES-FILE ASSIGN TO "SALESEDIT.TXT"
                   ORGANIZATION IS SEQUENTIAL.

            SELECT PRINT-FILE ASSIGN   TO  "PRINTER".

            SELECT ERROR-REPORT ASSIGN TO  "PRINTER".
       DATA DIVISION.
       FILE SECTION.
       FD   SALES-FILE.
       01   SALES-REC.
            05 SP-REC-CODE             PIC X(2).
            05 SP-REGION               PIC X(2).
            05 SP-TERRITORY            PIC 9(4).
            05 SP-NO                   PIC 9(3).
            05 SP-NAME                 PIC X(25).
            05 UNIT-PRICE              PIC 9(2)V99.
            05 UNITS-SOLD              PIC 9(3).

       FD   PRINT-FILE.
       01   PRINT-REC                  PIC X(132).

       FD   ERROR-REPORT.
       01   ERROR-REC               PIC X(132).

       WORKING-STORAGE SECTION.
       77   EOF                        PIC X(3)    VALUE "NO ".
       77   FIRST-REC                  PIC X(1)    VALUE "Y".
       77   SAVE-SP-NO                 PIC 9(3)    VALUE ZEROS.
       77   PAGE-SIZE                  PIC 9(2)    VALUE 60.

       77   LINE-COUNT                 PIC 9(2)    VALUE ZEROS.
       77   LINE-SPACING               PIC 9(2)    VALUE ZEROS.

       01   HEADING-LINE1.
            05 FILLER                  PIC X(132)  VALUE ALL  "_".
       01   HEADING-LINE2.
            05 FILLER                  PIC X(6)    VALUE "REGION".
            05 FILLER                  PIC X(2).
            05 FILLER                  PIC X(13)   VALUE "SALESPERSONS".
            05 FILLER                  PIC X(13)   VALUE "SALESPERSONS".
            05 FILLER                  PIC X(2).
            05 FILLER                  PIC X(13)   VALUE "SALESPERSONS".
            05 FILLER                  PIC X(2).
            05 FILLER                  PIC X(8)    VALUE  "PRODUCTS".
            05 FILLER                  PIC X(13)   VALUE "SALESPERSONS".
            05 FILLER                  PIC X(2).
            05 FILLER                  PIC X(13)   VALUE "SALESPERSONS".
            05 FILLER                  PIC X(2).
       01   HEADING-LINE3.
            05 FILLER                  PIC X(12).
            05 FILLER                  PIC X(9)    VALUE "TERRITORY".
            05 FILLER                  PIC X(8).
            05 FILLER                  PIC X(6)    VALUE "NUMBER".
            05 FILLER                  PIC X(10).
            05 FILLER                  PIC X(8)   VALUE  "EARNINGS".
            05 FILLER                  PIC X(10).
            05 FILLER                  PIC X(5)    VALUE "BONUS".

       01   DETAIL-LINE.
            05 FILLER                  PIC X(3).
            05 SP-REGION-PRINT         PIC X(2).
            05 FILLER                  PIC X(12).
            05 SP-TERRITORY-PRINT      PIC X(2).
            05 FILLER                  PIC X(15).
            05 SP-NO-PRINT             PIC 9(3).
            05 FILLER                  PIC X(15).
            05 SP-NAME-PRINT           PIC X(25).
            05 FILLER                  PIC X(2).
            05 UNITS-SOLD-PRINT        PIC Z(3).
            05 FILLER                  PIC X(2).
            05 SP-EARNINGS-PRINT       PIC $(5).99.
            05 FILLER                  PIC X(2).
            05 SP-BONUS-PRINT          PIC $(7).99.
            05 FILLER                  PIC X(5).
            05 SP-PAYROLL-PRINT        PIC $(7).99.

       01   ERROR-LINE.
            05 ERROR-MSG               PIC X(60).

       01   TOTAL-LINE.
            05 FILLER                  PIC X(45).
            05 TOT-EARNINGS-PRINT      PIC $(7).99.
            05 FILLER                  PIC X(5).
            05 TOT-BONUS-PRINT         PIC Z(7).99.
            05 FILLER                  PIC X(5).
            05 TOT-PAYROLL-PRINT       PIC $(7).99.

       01   PROGRAM-ACCUMULATORS.
            05 TOT-BONUS               PIC 9(7)V99.
            05 TOT-EARNINGS            PIC 9(7)V99.
            05 TOT-PAYROLL             PIC 9(7)V99.

       01   PROGRAM-WORK-AREAS.
            05 SP-SALES-AMOUNT         PIC 9(5)V99.
            05 SP-BONUS                PIC 9(7)V99.
            05 SP-PAYROLL              PIC 9(7)V99.            

       PROCEDURE DIVISION.
       MAIN-RTN.
            OPEN INPUT  SALES-FILE
                 OUTPUT PRINT-FILE
                        ERROR-REPORT.

            PERFORM READ-REC THRU READ-REC-EXIT UNTIL EOF = "YES".

            PERFORM PRINT-TOTALS.

            CLOSE SALES-FILE
                  PRINT-FILE
                  ERROR-REPORT.
            STOP RUN.

       READ-REC.
            READ SALES-FILE AT END
                 MOVE "YES"    TO EOF
                 GO TO READ-REC-EXIT.

            IF SP-REC-CODE NOT = "25" THEN
               MOVE "ERROR - INVALID RECORD TYPE NOT 25" TO ERROR-MSG
               PERFORM WRITE-ERROR
               GO TO READ-REC-EXIT.

            IF LINE-COUNT = ZEROS OR
               LINE-COUNT > PAGE-SIZE THEN
               PERFORM PRINT-HEADINGS
               MOVE 2         TO LINE-SPACING
            ELSE
               MOVE 1         TO LINE-SPACING.

            PERFORM PRINT-DETAIL-LINE.
       READ-REC-EXIT.
            EXIT.

       PRINT-DETAIL-LINE.
            MOVE SP-REGION    TO SP-REGION-PRINT.
            MOVE SP-TERRITORY TO SP-TERRITORY-PRINT.
            MOVE SP-NO        TO SP-NO-PRINT.
            MOVE SP-NAME      TO SP-NAME-PRINT.
            MOVE UNITS-SOLD   TO UNITS-SOLD-PRINT.           

            COMPUTE SP-SALES-AMOUNT = UNITS-SOLD * UNIT-PRICE.
            ADD SP-SALES-AMOUNT TO TOT-EARNINGS.

            IF TOT-EARNINGS =  100000  AND
               TOT-EARNINGS <  500000  THEN
               COMPUTE SP-BONUS = SP-SALES-AMOUNT *  2.5 /  100.

            IF TOT-EARNINGS > 500000  AND
               TOT-EARNINGS < 1000000 THEN
               COMPUTE SP-BONUS = SP-SALES-AMOUNT *  5 /  100.

            IF TOT-EARNINGS > 1000000 THEN
               COMPUTE SP-BONUS = SP-SALES-AMOUNT * 10 /  100.  

            ADD SP-BONUS          TO TOT-BONUS.
            COMPUTE TOT-PAYROLL = SP-SALES-AMOUNT + SP-BONUS.

            MOVE SP-SALES-AMOUNT TO SP-EARNINGS-PRINT.
            MOVE SP-BONUS        TO SP-BONUS-PRINT.
            MOVE SP-PAYROLL      TO SP-PAYROLL-PRINT.
            WRITE PRINT-REC FROM TOTAL-LINE AFTER ADVANCING LINE-SPACING.
            ADD LINE-SPACING     TO LINE-COUNT.
            MOVE ZEROS           TO PROGRAM-WORK-AREAS.

       PRINT-HEADINGS.
            WRITE PRINT-REC FROM HEADING-LINE1 AFTER ADVANCING PAGE.
            WRITE PRINT-REC FROM HEADING-LINE2 AFTER ADVANCING 1 LINE.
            WRITE PRINT-REC FROM HEADING-LINE2 AFTER ADVANCING 1 LINE.
            WRITE PRINT-REC FROM HEADING-LINE1 AFTER ADVANCING 1 LINE.
            ADD 7 TO LINE-COUNT.
       PRINT-TOTALS.

            MOVE TOT-PAYROLL   TO TOT-PAYROLL-PRINT.
            MOVE TOT-BONUS     TO TOT-BONUS-PRINT.
            MOVE TOT-PAYROLL   TO TOT-PAYROLL-PRINT.
            WRITE PRINT-REC  FROM TOTAL-LINE AFTER ADVANCING 2 LINES.

       WRITE-ERROR.
            WRITE ERROR-REC  FROM ERROR-LINE AFTER ADVANCING 1 LINE.

This is the first program, if this help students am willing to post more sample programs code. All the Division names and Paragraphs start at column 8 of your editor. All the COBOL statements start at column 12 of your editor. The WordPress don’t let me define the proper spacing. Make your own standards of aligning picture clause at column 40, indent the Procedure division statements.

Read SALES-FILE AT END

———->MOVE “YES” TO EOF.

OR

IF RECORD-CODE NOT = “25”

–>MOVE “ERROR” TO ERR-MSG

—>PERFORM ERROR-RTN

END-IF. (End If may not be recognized properly with your PC compilers like Fijistu or Micro Focus COBOL.

Following is the input file SALESEDIT.TXT.

25NW0100014DEVOR, ERNEST N A0075 755 00282840003771220003000000
10NW3800015LYKE, SHARON SHARA A1250 030 00187310000149850000090000
25NW3800016LATING, CAL Q A1125 142 00797950000709290001400000
abNW3800017KATED, ED U A0975 276 01344150001378620001000000
25NE3500005YOUZERS, BILL D A1300 796 05168830003976020001900000
25NE3500006WAGNER, GUY A1250 746 04657840003726270004000000
25SW0400042WILMER, PATRICE A1175 815 04783340004070925003000000
10SW0400043MYLES, IDA WALKER A1350 7!0 05057440003746250004400000
25SW0500044TIME, NICK A A1275 005 00031840000024975000040000
25SW0500045THRUST, PERRY N A1525 523 03983890002612385002200000
25SW0500046HUMPHREY, STAN A0800 249 00995000001243755002400000
15SW0500047LOGAN, KRISTIN I1050 393 02061190001963035001500000
25SW0500048NATION, BERTHA V C0925 028 00129370000139860000100000
25SW0500049SCHULTZ, CHARLES I1150 184 01056940000919080000950000
00SW0500050CARVER, GEORGE A147a 8oo 05894100003996000003996000
25SW0500051CARTOZIAN, ARAM A1325 199 01317060000994005020000000
25SW3300052FORSYTHE, ROBERT ALEXANDERAq805 592 02380420002957040001000000
25NE3500007HAMILTON, BRUCE A0975 263 01280840001313680002600000
25NE3500008FITTS, BEN E C1425 902 06420320004505490003000000
25NE2000001PICATTA, BEVERLY A1025 290 01510360001473520000700000
25NE2000002LEAR, CRYSTAL SHANDA A1550 891 06898340004450540003000000
25NE2000003PAPPAS, JENNIFER A0875 060 00262240000299700000300000
25NE3500009PARSONS, LAURIE A1000 457 02282720002282710002300000
25NE3900010SNOW, MEREDITH A0850 202 00857640001008990000900000
25NE3900011WILLING, ABEL N A0925 826 03816430004125870002100000
25NE3900012DAY, ONA CLAIRE A1105 403 02224350002012980002500000
NE4000013FOREVAR, YUKON C A1300 570 03701300002847150002600000
25NW4800018CALLAHAN, KATHLEEN A1505 240 01804190001198800002200000
25NW4800019ERMINE, URA PLACE A1450 665 04816430003321670001800000
25NW4800020SANDERS, GARY A0800 998 03988010004985010005000000
25NW4800021ENDICOTT, PAMELA C1325 536 03547450002677320002500000
25NW4800022DICKENS, GIVEN D A1075 485 02604270002422570004800000
25MW1500023BENEDICT, HAMMOND X A0900 033 00148350000164830000200000
25MW1500024HASTE, MARY N A1505 550 04134610002747250001300000
25MW1600025YARBOROUGH, JEFFREY C1225 099 00605770000494500000800000
25MW1700026ABINGTON, CARL A0850 330 01401100001648350001000000
25MW1700027STRUCKSON, EVA D I1475 672 04951040003356640003500000
25MW5100028ASHTON, WILLIAM A1105 001 00055190000049950000020000
25MW5100029YOUNG, ROGER A1000 239 01193810001193800002000000
25SE2400030DANCE, JUAN A I1000 239 01193810001193800002000000
25SE1000031WOOD, U BETTY A1050 028 00146850000139860001200000
25SE1000032BUSTER, PHIL A A0875 640 02797200003196800003300000
25SE1000033QUICK, DEVORS M A1100 484 02659340002417580004800000
25SE1100034WORTHIT, HART LEE A1025 235 01203170001173825000500000
25SE1100035STEWART, JANET A1250 680 04245750003396600006600000
25SE1100036NEAR, SUE V A1575 592 04657340002957040002800000
25SE1800037ZEOM, JIM NAY A0900 562 02526470002807190001500000
25SE1800038COLLINS, BRUCE C1350 311 02097150001553445002000000
25SE2800039REILLY, JACK A1425 173 01231390000864135000400000
25SE2800040COOPER, ROXANNE A1005 983 04934640004910085005000000
25SE2800041DOLLAR, SHURR RINCON A0000 000 00000000000399600000000000
25SW3300053HARRIS, SEAN A1050 654 03430070003266730003000000
25SW3350054ALVAREZ, ELENA A1175 140 00821680000699300001380000
25SW4400055KNEAD, PHIL A A0900 755 03394100003771225003200000
25SW4400056XAVIER, FRANCIS A1525 068 00517980000339660000160000
25SW4400057LANDUSKEY, FRED A1350 209 01409340001043955002000000
25SW4400058KLINE, I D A1400 723 05055940003611385001800000
25SW4400059HELM, SIGRID A1205 615 03701670003071925001500000
25SW4400060BYRD, EARL E I0009 626 00028140003126870006000000

Posted in COBOL, Technology | 10 Comments »

Disconnected from News.

Posted by QB on December 12, 2006

I completely disconnected myself from all sort of news which really are the same from last six years since Bush regime take over the White House. The same killings, bombing, killing in the name of sectarian differences, killing in the name of “war on terror”, killing for the God’s given land some 5000 years back. I suddently lost interest with hypocrisy of main stream media giving air time to news stories which really does not have much material to report for weeks and weeks and ignoring the important news. CNN from the last few weeks are paying way too much importance to one Russian Spy death without any proof blaming Putin for his death. Bush has nothing new to say and I have listen to his stupid opinion that staying on the course will make USA safe and they will win the war on terror. The fact is that Bush has already lost in Afghanistan and Iraq and there is nothing that they can do to change the results.

I find something more interesting to look at ignoring all the news.

Working on IBM DB2 and using the Database for my Web and Java Projects using IBM WebSphare Application Developer.  I looked at many different Web Application Development Software including Microsoft Visual Studio and Sequal Server and after working with IBM products come to the conclusion that they are the best. The WebSphere might be little complicated for people who are familiar with Microsoft products because of its setup and the directory structure but once get used to it than it become more interesting. IBM WebSphere Application product come with all the plugins which are required to design any Web, Java, J2EE, Server applications.

I will keep working on IBM DB2 and WebSphere until I once again get connected to the news and maybe post something more about setting up DB2 Websphere projects if someone find it interesting.

Posted in Bush, George W. Bush, Hugo Chavez, IBM - WebSphere Studio Application Developer, IBM DB2, IBM DB2 UDB, Iraq, Latin America, Middle East, Middle East War, Middle Eastern affairs, Middle Eastern Politics, Politics, Putin, Russia, South America, Technology, US Politics, Vladimir Putin, War on Terror | 4 Comments »