I'm a newbie in this IBM mainframe subjects.
I've been offered the possibility of using a mainframe z/OS, only for learning purposes.
In the last weeks I worked in it and I've already created several COBOL - CICS programs, Conversational and Pseudo - Conversational.
In this week I created my first COBOL program to write/read a "file" VSAM Data Set.
I decided to use a ESDS sequential Data Set (please see attached file).
After that I created the BMS MAP/MAPSET and compiled it with success (MAX CC=0).
Then I created the COBOL program, which was compiled successfully.
Later, I logged in the CICS region.
I made the CEDA DEF to define MAPSET, GROUP, PROGRAM and FILE.
I made the CEDA INSTALL to install MAPSET, GROUP, PROGRAM and FILE.
I do the CEDF to Debug.
When I write the transaction code ('ECAR'), the program initiates and imediately abends with an ABEND CODE 4038.
I searched in several sites but I don't know what I'm doing wrong and how to correct it.
So, I'm asking for your help.
Thank you.
Roger
P.S. Below you can see the code of the MAP/MAPSET and the COBOL Program
------------------------------------------------------>MAP/MAPSET
CARMAP DFHMSD TYPE=&SYSPARM,LANG=COBOL,TERM=3270,MODE=INOUT, X
TIOAPFX=YES,CTRL=FREEKB,STORAGE=AUTO,EXTATT=YES
CARMA DFHMDI SIZE=(24,80),LINE=1,COLUMN=1
DFHMDF POS=(3,1), X
ATTRB=PROT, X
INITIAL='OPTION:', X
LENGTH=7
DFHMDF POS=(5,1), X
ATTRB=PROT, X
INITIAL='DATA:', X
LENGTH=5
DFHMDF POS=(7,1), X
ATTRB=PROT, X
INITIAL='MESSAGE:', X
LENGTH=8
DFHMDF POS=(9,1), X
ATTRB=PROT, X
INITIAL='SALE DATE:', X
LENGTH=10
DFHMDF POS=(11,1), X
ATTRB=PROT, X
INITIAL='BRAND:', X
LENGTH=6
DFHMDF POS=(13,1), X
ATTRB=PROT, X
INITIAL='MODEL:', X
LENGTH=6
DFHMDF POS=(15,1), X
ATTRB=PROT, X
INITIAL='CAR PLATE:', X
LENGTH=10
DFHMDF POS=(17,1), X
ATTRB=PROT, X
INITIAL='CLIENT:', X
LENGTH=7
DFHMDF POS=(19,1), X
ATTRB=PROT, X
INITIAL='PHONE:', X
LENGTH=6
DFHMDF POS=(20,1), X
ATTRB=PROT, X
INITIAL='MADE IN:', X
LENGTH=8
DFHMDF POS=(21,1), X
ATTRB=PROT, X
INITIAL='MILEAGE:', X
LENGTH=8
DFHMDF POS=(22,1), X
ATTRB=PROT, X
INITIAL='PRICE:', X
LENGTH=6
CDAY DFHMDF POS=(1,20),INITIAL=' ', X
LENGTH=24,ATTRB=PROT
OPT DFHMDF POS=(3,10),INITIAL=' ', X
LENGTH=18,ATTRB=(UNPROT,IC),HILIGHT=UNDERLINE
DFHMDF POS=(3,29),INITIAL=' ', X
LENGTH=1,ATTRB=ASKIP
INFO DFHMDF POS=(5,10),INITIAL=' ',LENGTH=18, X
ATTRB=UNPROT,HILIGHT=UNDERLINE
DFHMDF POS=(5,29),INITIAL=' ', X
LENGTH=1,ATTRB=ASKIP
MSG DFHMDF POS=(7,10),INITIAL=' ', X
LENGTH=70,ATTRB=UNPROT,HILIGHT=UNDERLINE
DFHMDF POS=(7,81),INITIAL=' ', X
LENGTH=1,ATTRB=ASKIP
SALE DFHMDF POS=(9,12),INITIAL=' ',LENGTH=18, X
ATTRB=UNPROT,HILIGHT=UNDERLINE
DFHMDF POS=(9,31),INITIAL=' ', X
LENGTH=1,ATTRB=ASKIP
BRAND DFHMDF POS=(11,12),INITIAL=' ',LENGTH=18, X
ATTRB=UNPROT,HILIGHT=UNDERLINE
DFHMDF POS=(11,31),INITIAL=' ', X
LENGTH=1,ATTRB=ASKIP
MODEL DFHMDF POS=(13,12),INITIAL=' ',LENGTH=18, X
ATTRB=UNPROT,HILIGHT=UNDERLINE
DFHMDF POS=(13,31),INITIAL=' ', X
LENGTH=1,ATTRB=ASKIP
PLATE DFHMDF POS=(15,12),INITIAL=' ',LENGTH=18, X
ATTRB=UNPROT,HILIGHT=UNDERLINE
DFHMDF POS=(15,31),INITIAL=' ', X
LENGTH=1,ATTRB=ASKIP
CLIENT DFHMDF POS=(17,12),INITIAL=' ',LENGTH=18, X
ATTRB=UNPROT,HILIGHT=UNDERLINE
DFHMDF POS=(17,31),INITIAL=' ', X
LENGTH=1,ATTRB=ASKIP
PHONE DFHMDF POS=(19,12),INITIAL=' ',LENGTH=18, X
ATTRB=UNPROT,HILIGHT=UNDERLINE
DFHMDF POS=(19,31),INITIAL=' ', X
LENGTH=1,ATTRB=ASKIP
CREAT DFHMDF POS=(20,12),INITIAL=' ',LENGTH=18, X
ATTRB=UNPROT,HILIGHT=UNDERLINE
DFHMDF POS=(20,31),INITIAL=' ', X
LENGTH=1,ATTRB=ASKIP
MILES DFHMDF POS=(21,12),INITIAL=' ',LENGTH=18, X
ATTRB=UNPROT,HILIGHT=UNDERLINE
DFHMDF POS=(21,31),INITIAL=' ', X
LENGTH=1,ATTRB=ASKIP
PRICE DFHMDF POS=(22,12),INITIAL=' ',LENGTH=18, X
ATTRB=UNPROT,HILIGHT=UNDERLINE
DFHMDF POS=(22,31),INITIAL=' ', X
LENGTH=1,ATTRB=ASKIP
DFHMSD TYPE=FINAL
END
CARMAP DFHMSD TYPE=&SYSPARM,LANG=COBOL,TERM=3270,MODE=INOUT, X
TIOAPFX=YES,CTRL=FREEKB,STORAGE=AUTO,EXTATT=YES
CARMA DFHMDI SIZE=(24,80),LINE=1,COLUMN=1
DFHMDF POS=(3,1), X
ATTRB=PROT, X
INITIAL='OPTION:', X
LENGTH=7
DFHMDF POS=(5,1), X
ATTRB=PROT, X
INITIAL='DATA:', X
LENGTH=5
DFHMDF POS=(7,1), X
ATTRB=PROT, X
INITIAL='MESSAGE:', X
LENGTH=8
DFHMDF POS=(9,1), X
ATTRB=PROT, X
INITIAL='SALE DATE:', X
LENGTH=10
DFHMDF POS=(11,1), X
ATTRB=PROT, X
INITIAL='BRAND:', X
LENGTH=6
DFHMDF POS=(13,1), X
ATTRB=PROT, X
INITIAL='MODEL:', X
LENGTH=6
DFHMDF POS=(15,1), X
ATTRB=PROT, X
INITIAL='CAR PLATE:', X
LENGTH=10
DFHMDF POS=(17,1), X
ATTRB=PROT, X
INITIAL='CLIENT:', X
LENGTH=7
DFHMDF POS=(19,1), X
ATTRB=PROT, X
INITIAL='PHONE:', X
LENGTH=6
DFHMDF POS=(20,1), X
ATTRB=PROT, X
INITIAL='MADE IN:', X
LENGTH=8
DFHMDF POS=(21,1), X
ATTRB=PROT, X
INITIAL='MILEAGE:', X
LENGTH=8
DFHMDF POS=(22,1), X
ATTRB=PROT, X
INITIAL='PRICE:', X
LENGTH=6
CDAY DFHMDF POS=(1,20),INITIAL=' ', X
LENGTH=24,ATTRB=PROT
OPT DFHMDF POS=(3,10),INITIAL=' ', X
LENGTH=18,ATTRB=(UNPROT,IC),HILIGHT=UNDERLINE
DFHMDF POS=(3,29),INITIAL=' ', X
LENGTH=1,ATTRB=ASKIP
INFO DFHMDF POS=(5,10),INITIAL=' ',LENGTH=18, X
ATTRB=UNPROT,HILIGHT=UNDERLINE
DFHMDF POS=(5,29),INITIAL=' ', X
LENGTH=1,ATTRB=ASKIP
MSG DFHMDF POS=(7,10),INITIAL=' ', X
LENGTH=70,ATTRB=UNPROT,HILIGHT=UNDERLINE
DFHMDF POS=(7,81),INITIAL=' ', X
LENGTH=1,ATTRB=ASKIP
SALE DFHMDF POS=(9,12),INITIAL=' ',LENGTH=18, X
ATTRB=UNPROT,HILIGHT=UNDERLINE
DFHMDF POS=(9,31),INITIAL=' ', X
LENGTH=1,ATTRB=ASKIP
BRAND DFHMDF POS=(11,12),INITIAL=' ',LENGTH=18, X
ATTRB=UNPROT,HILIGHT=UNDERLINE
DFHMDF POS=(11,31),INITIAL=' ', X
LENGTH=1,ATTRB=ASKIP
MODEL DFHMDF POS=(13,12),INITIAL=' ',LENGTH=18, X
ATTRB=UNPROT,HILIGHT=UNDERLINE
DFHMDF POS=(13,31),INITIAL=' ', X
LENGTH=1,ATTRB=ASKIP
PLATE DFHMDF POS=(15,12),INITIAL=' ',LENGTH=18, X
ATTRB=UNPROT,HILIGHT=UNDERLINE
DFHMDF POS=(15,31),INITIAL=' ', X
LENGTH=1,ATTRB=ASKIP
CLIENT DFHMDF POS=(17,12),INITIAL=' ',LENGTH=18, X
ATTRB=UNPROT,HILIGHT=UNDERLINE
DFHMDF POS=(17,31),INITIAL=' ', X
LENGTH=1,ATTRB=ASKIP
PHONE DFHMDF POS=(19,12),INITIAL=' ',LENGTH=18, X
ATTRB=UNPROT,HILIGHT=UNDERLINE
DFHMDF POS=(19,31),INITIAL=' ', X
LENGTH=1,ATTRB=ASKIP
CREAT DFHMDF POS=(20,12),INITIAL=' ',LENGTH=18, X
ATTRB=UNPROT,HILIGHT=UNDERLINE
DFHMDF POS=(20,31),INITIAL=' ', X
LENGTH=1,ATTRB=ASKIP
MILES DFHMDF POS=(21,12),INITIAL=' ',LENGTH=18, X
ATTRB=UNPROT,HILIGHT=UNDERLINE
DFHMDF POS=(21,31),INITIAL=' ', X
LENGTH=1,ATTRB=ASKIP
PRICE DFHMDF POS=(22,12),INITIAL=' ',LENGTH=18, X
ATTRB=UNPROT,HILIGHT=UNDERLINE
DFHMDF POS=(22,31),INITIAL=' ', X
LENGTH=1,ATTRB=ASKIP
DFHMSD TYPE=FINAL
END
-------------------------------------------------->END OF MAP/MAPSET
------------------------------------------------------>COBOL Program
000100 IDENTIFICATION DIVISION. 00010001
000200 PROGRAM-ID. CARPRG. 00020099
000300 AUTHOR. RMQB. 00030002
000400* --------------------------------------------- 00040002
000500* OBJECTIVE: WRITE AND READ - SEQUENTIAL FILE 00050099
000600* CARS INFORMATION 00060099
000700* --------------------------------------------- 00070002
000800 ENVIRONMENT DIVISION. 00080002
000900 CONFIGURATION SECTION. 00090002
001000 SOURCE-COMPUTER. HERCULES. 00100002
001100 OBJECT-COMPUTER. HERCULES. 00110002
001200 INPUT-OUTPUT SECTION. 00120099
001300 FILE-CONTROL. 00130099
001400 SELECT CAR ASSIGN CARSDD 00140099
001500 ORGANIZATION IS SEQUENTIAL 00150099
001510 ACCESS MODE IS SEQUENTIAL 00151099
001600 FILE STATUS IS FS-CAR. 00160099
001700 DATA DIVISION. 00170002
001800 FILE SECTION. 00180099
001900 FD CAR. 00190099
002000 01 REGISTO. 00200099
002010 05 CARNO PIC 9(3). 00201099
002100 05 DATESOLD PIC X(10). 00210099
002200 05 FILLER PIC X(01). 00220099
002300 05 CARBRAND PIC X(10). 00230099
002400 05 CARMODEL PIC X(10). 00240099
002500 05 REGISTRATION PIC X(09). 00250099
002600 05 CLIENTNAME PIC X(10). 00260099
002700 05 CONTACT PIC 9(09). 00270099
002800 05 FILLER PIC X(01). 00280099
002900 05 PRODUCTIONYEAR PIC 9(04). 00290099
003000 05 FILLER PIC X(01). 00300099
003100 05 MILEAGE PIC 9(06). 00310099
003200 05 FILLER PIC X(01). 00320099
003300 05 CARPRICE PIC 9(05). 00330099
003400 WORKING-STORAGE SECTION. 00340002
003500 01 FS-CAR PIC X(02) VALUE SPACES. 00350099
003600 88 FS-CAR-OK VALUE '00'. 00360099
003700 88 FS-CAR-EOF VALUE '10'. 00370099
003800 01 WS-MESSAGE PIC X(70). 00380099
003900 01 WS-COMMAREA PIC X(10) VALUE SPACES. 00390094
004000 01 OPTION-IN. 00400099
004100 05 OPTION PIC X(18). 00410099
004200 01 FILEDATA. 00420099
004300 05 DATA-WRITE PIC X(18). 00430099
004400 05 DATA-READ PIC X(18). 00440099
004500 01 WS-ABSTIME PIC S9(15) COMP-3. 00450099
004600 01 WS-DATE PIC X(10). 00460099
004700 01 WS-DAYWEEK PIC S9(8) USAGE BINARY. 00470099
004800 01 WS-NAMEDAY PIC X(09). 00480099
005700 01 COUNTERS. 00570099
005800 05 READ-COUNT PIC 9(2). 00580099
005810 05 CAR-COUNT PIC 9(3). 00581099
005900 01 WS-LEN PIC S9(4) COMP. 00590099
005901 01 WS-KEY-LEN PIC S9(4) COMP. 00590199
005910 01 WS-STD-REC-KEY PIC 9(3). 00591099
005920 01 CH1 PIC X(01) VALUE 'S'. 00592099
005930 01 CH2 PIC X(01) VALUE 'S'. 00593099
005940 01 CH3 PIC X(01) VALUE 'S'. 00594099
006000 COPY CARMAP. 00600099
006100 LINKAGE SECTION. 00610036
006200 01 DFHCOMMAREA PIC X(10). 00620036
006300* TRANS(ECAR) MAPSET(CARMAP) GROUP(CARPRG) 00630099
006400*MAP FIELDS OPT INFO MSG SALE BRAND MODEL PLATE CLIENT 00640099
006410*CONTINUED PHONE CREAT (CREATION DATE) MILES PRICE 00641099
006500 PROCEDURE DIVISION. 00650002
006600 000-MAIN. 00660099
006700 MOVE DFHCOMMAREA TO WS-COMMAREA. 00670047
006800 IF EIBCALEN = 0 THEN 00680099
006900 PERFORM 010-PREPARE 00690099
007000 MOVE 'FIRST' TO WS-COMMAREA 00700099
007010 MOVE SPACES TO REGISTO 00701099
007020 INITIALIZE REGISTO 00702099
007100 INITIALIZE FS-CAR READ-COUNT 00710099
007200 INITIALIZE WS-LEN WS-STD-REC-KEY 00720099
007300 MOVE 1 TO CAR-COUNT 00730099
007600 END-IF. 00760099
007700* FILLER/SEPARATOR 00770099
007800 IF EIBCALEN > 0 THEN 00780099
007900 PERFORM 010-PREPARE 00790099
008000 END-IF. 00800099
009000 PERFORM 020-CHOICE. 00900099
009200 EXEC CICS 00920099
009300 RETURN 00930099
009400 END-EXEC. 00940099
009500 GOBACK. 00950099
009600 010-PREPARE. 00960099
009700 MOVE LOW-VALUES TO CARMAI, CARMAO. 00970099
009800 MOVE "PLAYER 1: INSERT NAMES IN THE NAME FIELD" TO MSGO. 00980099
009900 EXEC CICS 00990099
010000 ASKTIME 01000099
010100 ABSTIME(WS-ABSTIME) 01010099
010200 END-EXEC. 01020099
010300 EXEC CICS 01030099
010400 FORMATTIME 01040099
010500 ABSTIME(WS-ABSTIME) 01050099
010600 DDMMYYYY(WS-DATE) 01060099
010700 DATESEP('/') 01070099
010800 END-EXEC. 01080099
010900 EXEC CICS 01090099
011000 FORMATTIME 01100099
011100 ABSTIME(WS-ABSTIME) 01110099
011200 DAYOFWEEK(WS-DAYWEEK) 01120099
011300 END-EXEC. 01130099
011400 EVALUATE WS-DAYWEEK 01140099
011500 WHEN 0 01150099
011600 MOVE "SUNDAY" TO WS-NAMEDAY 01160099
011700 WHEN 1 01170099
011800 MOVE "MONDAY" TO WS-NAMEDAY 01180099
011900 WHEN 2 01190099
012000 MOVE "TUESDAY" TO WS-NAMEDAY 01200099
012100 WHEN 3 01210099
012200 MOVE "WEDNESDAY" TO WS-NAMEDAY 01220099
012300 WHEN 4 01230099
012400 MOVE "THURSDAY" TO WS-NAMEDAY 01240099
012500 WHEN 5 01250099
012600 MOVE "FRIDAY" TO WS-NAMEDAY 01260099
012700 WHEN 6 01270099
012800 MOVE "SATURDAY" TO WS-NAMEDAY 01280099
012900 END-EVALUATE. 01290099
013000 MOVE WS-NAMEDAY TO WS-MESSAGE (1:10). 01300099
013100 MOVE ', ' TO WS-MESSAGE (11:3). 01310099
013200 MOVE WS-DATE TO WS-MESSAGE (14:10). 01320099
013300 MOVE WS-MESSAGE TO CDAYO. 01330099
013500* END-IF. 01350099
013600 020-CHOICE. 01360099
013700* MOVE YI TO YOUT. 01370099
013800 PERFORM UNTIL CH1 = 'N' 01380099
013900 MOVE LOW-VALUES TO CARMAI, CARMAO 01390099
014000 MOVE SPACES TO CDAYI 01400099
014100 MOVE SPACES TO CDAYO 01410099
014200* MOVE 0 TO WCOUNTDUPL. 01420099
014300 MOVE "OPTIONS| 0: EXIT/1: NEW RECORD/2: SHOW ALL" TO MSGO 01430099
014400 MOVE WS-NAMEDAY TO WS-MESSAGE (1:10) 01440099
014500 MOVE ', ' TO WS-MESSAGE (11:3) 01450099
014600 MOVE WS-DATE TO WS-MESSAGE (14:10) 01460099
014700 MOVE WS-MESSAGE TO CDAYO 01470099
014800 PERFORM 030-SEND-MAP 01480099
014900* EXEC CICS 01490099
015000* SEND MAP('NAMEMA') MAPSET('NAMEMAP') 01500099
015100* ERASE 01510099
015200* END-EXEC 01520099
015300 PERFORM 040-RECEIVE-MAP 01530099
015400* EXEC CICS 01540099
015500* RECEIVE MAP('NAMEMA') MAPSET('NAMEMAP') 01550099
015600* ASIS 01560099
015700* END-EXEC 01570099
015800 MOVE OPTI TO OPTION 01580099
015900 EVALUATE OPTION 01590099
016000 WHEN 1 01600099
016100 PERFORM 050-ADD-RECORD 01610099
016200 WHEN 2 01620099
016300 PERFORM 060-SHOW-RECORDS 01630099
016400 WHEN 0 01640099
016500 MOVE 'N' TO CH1 01650099
016600 END-EVALUATE 01660099
016610 END-PERFORM. 01661099
016700 030-SEND-MAP. 01670099
016800 EXEC CICS 01680099
016900 SEND MAP('CARMA') MAPSET('CARMAP') 01690099
017000 ERASE 01700099
017100 END-EXEC. 01710099
017200 040-RECEIVE-MAP. 01720099
017300 EXEC CICS 01730099
017400 RECEIVE MAP('CARMA') MAPSET('CARMAP') 01740099
017500 ASIS 01750099
017600 END-EXEC. 01760099
017700 050-ADD-RECORD. 01770099
017800 MOVE LOW-VALUES TO CARMAI, CARMAO. 01780099
017900 MOVE WS-NAMEDAY TO WS-MESSAGE (1:10). 01790099
018000 MOVE ', ' TO WS-MESSAGE (11:3). 01800099
018100 MOVE WS-DATE TO WS-MESSAGE (14:10). 01810099
018200 MOVE WS-MESSAGE TO CDAYO. 01820099
018210 MOVE CAR-COUNT TO CARNO. 01821099
019600 MOVE LOW-VALUES TO CARMAI, CARMAO. 01960099
019610 MOVE -1 TO INFOL. 01961099
019700 MOVE "WRITE THE DATE OF SALE (DD-MM-YYYY) IN DATA" TO MSGO. 01970099
019800 PERFORM 030-SEND-MAP. 01980099
019900 PERFORM 040-RECEIVE-MAP. 01990099
020000 MOVE INFOI TO DATESOLD. 02000099
020100 MOVE LOW-VALUES TO CARMAI, CARMAO. 02010099
020200 MOVE "WRITE THE CAR BRAND IN THE DATA FIELD" TO MSGO. 02020099
020300 PERFORM 030-SEND-MAP. 02030099
020400 PERFORM 040-RECEIVE-MAP. 02040099
020500 MOVE INFOI TO CARBRAND. 02050099
020600 MOVE LOW-VALUES TO CARMAI, CARMAO. 02060099
020700 MOVE "WRITE THE CAR MODEL IN THE DATA FIELD" TO MSGO. 02070099
020800 PERFORM 030-SEND-MAP. 02080099
020900 PERFORM 040-RECEIVE-MAP. 02090099
021000 MOVE INFOI TO CARMODEL. 02100099
021100 MOVE LOW-VALUES TO CARMAI, CARMAO. 02110099
021200 MOVE "WRITE THE LICENSE PLATE IN DATA FIELD" TO MSGO. 02120099
021300 PERFORM 030-SEND-MAP. 02130099
021400 PERFORM 040-RECEIVE-MAP. 02140099
021500 MOVE INFOI TO REGISTRATION. 02150099
021600 MOVE LOW-VALUES TO CARMAI, CARMAO. 02160099
021700 MOVE "WRITE THE NAME OF THE CLIENT IN DATA FIELD" TO MSGO. 02170099
021800 PERFORM 030-SEND-MAP. 02180099
021900 PERFORM 040-RECEIVE-MAP. 02190099
022000 MOVE INFOI TO CLIENTNAME. 02200099
022010 MOVE LOW-VALUES TO CARMAI, CARMAO. 02201099
022100 MOVE "WRITE THE PHONE OF CLIENT IN THE DATA FIELD" TO MSGO. 02210099
022200 PERFORM 030-SEND-MAP. 02220099
022300 PERFORM 040-RECEIVE-MAP. 02230099
022400 MOVE INFOI TO CONTACT. 02240099
022410 MOVE LOW-VALUES TO CARMAI, CARMAO. 02241099
022500 MOVE "WRITE WHICH YEAR THE CAR WAS MADE DATA FIELD" TO MSGO. 02250099
022600 PERFORM 030-SEND-MAP. 02260099
022700 PERFORM 040-RECEIVE-MAP. 02270099
022800 MOVE INFOI TO PRODUCTIONYEAR. 02280099
022810 MOVE LOW-VALUES TO CARMAI, CARMAO. 02281099
022900 MOVE "WRITE THE MILEAGE IN THE DATA FIELD" TO MSGO. 02290099
023000 PERFORM 030-SEND-MAP. 02300099
023100 PERFORM 040-RECEIVE-MAP. 02310099
023200 MOVE INFOI TO MILEAGE. 02320099
023210 MOVE LOW-VALUES TO CARMAI, CARMAO. 02321099
023300 MOVE "WRITE THE PRICE OF THE CAR IN DATA FIELD" TO MSGO. 02330099
023400 PERFORM 030-SEND-MAP. 02340099
023500 PERFORM 040-RECEIVE-MAP. 02350099
023600 MOVE INFOI TO CARPRICE. 02360099
023700 EXEC CICS WRITE 02370099
023800 FILE('CAR') 02380099
023900 FROM(REGISTO) 02390099
024000 LENGTH(WS-LEN) 02400099
024010 RIDFLD(CARNO) 02401099
024100 RBA 02410099
024200 END-EXEC. 02420099
024210 ADD 1 TO CAR-COUNT. 02421099
024300* CLOSE CAR. 02430099
024400 060-SHOW-RECORDS. 02440099
024500* OPEN INPUT CAR 02450099
024501 MOVE WS-LEN TO WS-KEY-LEN. 02450199
024510 MOVE 0 TO CARNO. 02451099
024600 EXEC CICS STARTBR 02460099
024700 FILE('CAR') 02470099
024800 RIDFLD(CARNO) 02480099
024810 RBA 02481099
024900 END-EXEC. 02490099
025000 PERFORM UNTIL FS-CAR-EOF 02500099
025100 EXEC CICS READNEXT 02510099
025200 FILE('CAR') 02520099
025300 INTO(REGISTO) 02530099
025310 LENGTH(WS-LEN) 02531099
025320 RIDFLD(CARNO) 02532099
025330 RBA 02533099
025400 END-EXEC 02540099
026000 ADD 1 TO READ-COUNT 02600099
026001 MOVE LOW-VALUES TO CARMAI, CARMAO 02600199
026002 MOVE WS-NAMEDAY TO WS-MESSAGE (1:10) 02600299
026003 MOVE ', ' TO WS-MESSAGE (11:3) 02600399
026004 MOVE WS-DATE TO WS-MESSAGE (14:10) 02600499
026005 MOVE WS-MESSAGE TO CDAYO 02600599
026010 MOVE 'READING RECORDS IN FILE' TO MSGO 02601099
026100 MOVE DATESOLD TO SALEO 02610099
026200 MOVE CARBRAND TO BRANDO 02620099
026500 MOVE CARMODEL TO MODELO 02650099
026600 MOVE REGISTRATION TO PLATEO 02660099
026900 MOVE CLIENTNAME TO CLIENTO 02690099
027000 MOVE CONTACT TO PHONEO 02700099
027300 MOVE PRODUCTIONYEAR TO CREATO 02730099
027400 MOVE MILEAGE TO MILESO 02740099
027700 MOVE CARPRICE TO PRICEO 02770099
027800 PERFORM 030-SEND-MAP 02780099
027900 END-PERFORM. 02790099
028000* CLOSE CAR. 02800099
000200 PROGRAM-ID. CARPRG. 00020099
000300 AUTHOR. RMQB. 00030002
000400* --------------------------------------------- 00040002
000500* OBJECTIVE: WRITE AND READ - SEQUENTIAL FILE 00050099
000600* CARS INFORMATION 00060099
000700* --------------------------------------------- 00070002
000800 ENVIRONMENT DIVISION. 00080002
000900 CONFIGURATION SECTION. 00090002
001000 SOURCE-COMPUTER. HERCULES. 00100002
001100 OBJECT-COMPUTER. HERCULES. 00110002
001200 INPUT-OUTPUT SECTION. 00120099
001300 FILE-CONTROL. 00130099
001400 SELECT CAR ASSIGN CARSDD 00140099
001500 ORGANIZATION IS SEQUENTIAL 00150099
001510 ACCESS MODE IS SEQUENTIAL 00151099
001600 FILE STATUS IS FS-CAR. 00160099
001700 DATA DIVISION. 00170002
001800 FILE SECTION. 00180099
001900 FD CAR. 00190099
002000 01 REGISTO. 00200099
002010 05 CARNO PIC 9(3). 00201099
002100 05 DATESOLD PIC X(10). 00210099
002200 05 FILLER PIC X(01). 00220099
002300 05 CARBRAND PIC X(10). 00230099
002400 05 CARMODEL PIC X(10). 00240099
002500 05 REGISTRATION PIC X(09). 00250099
002600 05 CLIENTNAME PIC X(10). 00260099
002700 05 CONTACT PIC 9(09). 00270099
002800 05 FILLER PIC X(01). 00280099
002900 05 PRODUCTIONYEAR PIC 9(04). 00290099
003000 05 FILLER PIC X(01). 00300099
003100 05 MILEAGE PIC 9(06). 00310099
003200 05 FILLER PIC X(01). 00320099
003300 05 CARPRICE PIC 9(05). 00330099
003400 WORKING-STORAGE SECTION. 00340002
003500 01 FS-CAR PIC X(02) VALUE SPACES. 00350099
003600 88 FS-CAR-OK VALUE '00'. 00360099
003700 88 FS-CAR-EOF VALUE '10'. 00370099
003800 01 WS-MESSAGE PIC X(70). 00380099
003900 01 WS-COMMAREA PIC X(10) VALUE SPACES. 00390094
004000 01 OPTION-IN. 00400099
004100 05 OPTION PIC X(18). 00410099
004200 01 FILEDATA. 00420099
004300 05 DATA-WRITE PIC X(18). 00430099
004400 05 DATA-READ PIC X(18). 00440099
004500 01 WS-ABSTIME PIC S9(15) COMP-3. 00450099
004600 01 WS-DATE PIC X(10). 00460099
004700 01 WS-DAYWEEK PIC S9(8) USAGE BINARY. 00470099
004800 01 WS-NAMEDAY PIC X(09). 00480099
005700 01 COUNTERS. 00570099
005800 05 READ-COUNT PIC 9(2). 00580099
005810 05 CAR-COUNT PIC 9(3). 00581099
005900 01 WS-LEN PIC S9(4) COMP. 00590099
005901 01 WS-KEY-LEN PIC S9(4) COMP. 00590199
005910 01 WS-STD-REC-KEY PIC 9(3). 00591099
005920 01 CH1 PIC X(01) VALUE 'S'. 00592099
005930 01 CH2 PIC X(01) VALUE 'S'. 00593099
005940 01 CH3 PIC X(01) VALUE 'S'. 00594099
006000 COPY CARMAP. 00600099
006100 LINKAGE SECTION. 00610036
006200 01 DFHCOMMAREA PIC X(10). 00620036
006300* TRANS(ECAR) MAPSET(CARMAP) GROUP(CARPRG) 00630099
006400*MAP FIELDS OPT INFO MSG SALE BRAND MODEL PLATE CLIENT 00640099
006410*CONTINUED PHONE CREAT (CREATION DATE) MILES PRICE 00641099
006500 PROCEDURE DIVISION. 00650002
006600 000-MAIN. 00660099
006700 MOVE DFHCOMMAREA TO WS-COMMAREA. 00670047
006800 IF EIBCALEN = 0 THEN 00680099
006900 PERFORM 010-PREPARE 00690099
007000 MOVE 'FIRST' TO WS-COMMAREA 00700099
007010 MOVE SPACES TO REGISTO 00701099
007020 INITIALIZE REGISTO 00702099
007100 INITIALIZE FS-CAR READ-COUNT 00710099
007200 INITIALIZE WS-LEN WS-STD-REC-KEY 00720099
007300 MOVE 1 TO CAR-COUNT 00730099
007600 END-IF. 00760099
007700* FILLER/SEPARATOR 00770099
007800 IF EIBCALEN > 0 THEN 00780099
007900 PERFORM 010-PREPARE 00790099
008000 END-IF. 00800099
009000 PERFORM 020-CHOICE. 00900099
009200 EXEC CICS 00920099
009300 RETURN 00930099
009400 END-EXEC. 00940099
009500 GOBACK. 00950099
009600 010-PREPARE. 00960099
009700 MOVE LOW-VALUES TO CARMAI, CARMAO. 00970099
009800 MOVE "PLAYER 1: INSERT NAMES IN THE NAME FIELD" TO MSGO. 00980099
009900 EXEC CICS 00990099
010000 ASKTIME 01000099
010100 ABSTIME(WS-ABSTIME) 01010099
010200 END-EXEC. 01020099
010300 EXEC CICS 01030099
010400 FORMATTIME 01040099
010500 ABSTIME(WS-ABSTIME) 01050099
010600 DDMMYYYY(WS-DATE) 01060099
010700 DATESEP('/') 01070099
010800 END-EXEC. 01080099
010900 EXEC CICS 01090099
011000 FORMATTIME 01100099
011100 ABSTIME(WS-ABSTIME) 01110099
011200 DAYOFWEEK(WS-DAYWEEK) 01120099
011300 END-EXEC. 01130099
011400 EVALUATE WS-DAYWEEK 01140099
011500 WHEN 0 01150099
011600 MOVE "SUNDAY" TO WS-NAMEDAY 01160099
011700 WHEN 1 01170099
011800 MOVE "MONDAY" TO WS-NAMEDAY 01180099
011900 WHEN 2 01190099
012000 MOVE "TUESDAY" TO WS-NAMEDAY 01200099
012100 WHEN 3 01210099
012200 MOVE "WEDNESDAY" TO WS-NAMEDAY 01220099
012300 WHEN 4 01230099
012400 MOVE "THURSDAY" TO WS-NAMEDAY 01240099
012500 WHEN 5 01250099
012600 MOVE "FRIDAY" TO WS-NAMEDAY 01260099
012700 WHEN 6 01270099
012800 MOVE "SATURDAY" TO WS-NAMEDAY 01280099
012900 END-EVALUATE. 01290099
013000 MOVE WS-NAMEDAY TO WS-MESSAGE (1:10). 01300099
013100 MOVE ', ' TO WS-MESSAGE (11:3). 01310099
013200 MOVE WS-DATE TO WS-MESSAGE (14:10). 01320099
013300 MOVE WS-MESSAGE TO CDAYO. 01330099
013500* END-IF. 01350099
013600 020-CHOICE. 01360099
013700* MOVE YI TO YOUT. 01370099
013800 PERFORM UNTIL CH1 = 'N' 01380099
013900 MOVE LOW-VALUES TO CARMAI, CARMAO 01390099
014000 MOVE SPACES TO CDAYI 01400099
014100 MOVE SPACES TO CDAYO 01410099
014200* MOVE 0 TO WCOUNTDUPL. 01420099
014300 MOVE "OPTIONS| 0: EXIT/1: NEW RECORD/2: SHOW ALL" TO MSGO 01430099
014400 MOVE WS-NAMEDAY TO WS-MESSAGE (1:10) 01440099
014500 MOVE ', ' TO WS-MESSAGE (11:3) 01450099
014600 MOVE WS-DATE TO WS-MESSAGE (14:10) 01460099
014700 MOVE WS-MESSAGE TO CDAYO 01470099
014800 PERFORM 030-SEND-MAP 01480099
014900* EXEC CICS 01490099
015000* SEND MAP('NAMEMA') MAPSET('NAMEMAP') 01500099
015100* ERASE 01510099
015200* END-EXEC 01520099
015300 PERFORM 040-RECEIVE-MAP 01530099
015400* EXEC CICS 01540099
015500* RECEIVE MAP('NAMEMA') MAPSET('NAMEMAP') 01550099
015600* ASIS 01560099
015700* END-EXEC 01570099
015800 MOVE OPTI TO OPTION 01580099
015900 EVALUATE OPTION 01590099
016000 WHEN 1 01600099
016100 PERFORM 050-ADD-RECORD 01610099
016200 WHEN 2 01620099
016300 PERFORM 060-SHOW-RECORDS 01630099
016400 WHEN 0 01640099
016500 MOVE 'N' TO CH1 01650099
016600 END-EVALUATE 01660099
016610 END-PERFORM. 01661099
016700 030-SEND-MAP. 01670099
016800 EXEC CICS 01680099
016900 SEND MAP('CARMA') MAPSET('CARMAP') 01690099
017000 ERASE 01700099
017100 END-EXEC. 01710099
017200 040-RECEIVE-MAP. 01720099
017300 EXEC CICS 01730099
017400 RECEIVE MAP('CARMA') MAPSET('CARMAP') 01740099
017500 ASIS 01750099
017600 END-EXEC. 01760099
017700 050-ADD-RECORD. 01770099
017800 MOVE LOW-VALUES TO CARMAI, CARMAO. 01780099
017900 MOVE WS-NAMEDAY TO WS-MESSAGE (1:10). 01790099
018000 MOVE ', ' TO WS-MESSAGE (11:3). 01800099
018100 MOVE WS-DATE TO WS-MESSAGE (14:10). 01810099
018200 MOVE WS-MESSAGE TO CDAYO. 01820099
018210 MOVE CAR-COUNT TO CARNO. 01821099
019600 MOVE LOW-VALUES TO CARMAI, CARMAO. 01960099
019610 MOVE -1 TO INFOL. 01961099
019700 MOVE "WRITE THE DATE OF SALE (DD-MM-YYYY) IN DATA" TO MSGO. 01970099
019800 PERFORM 030-SEND-MAP. 01980099
019900 PERFORM 040-RECEIVE-MAP. 01990099
020000 MOVE INFOI TO DATESOLD. 02000099
020100 MOVE LOW-VALUES TO CARMAI, CARMAO. 02010099
020200 MOVE "WRITE THE CAR BRAND IN THE DATA FIELD" TO MSGO. 02020099
020300 PERFORM 030-SEND-MAP. 02030099
020400 PERFORM 040-RECEIVE-MAP. 02040099
020500 MOVE INFOI TO CARBRAND. 02050099
020600 MOVE LOW-VALUES TO CARMAI, CARMAO. 02060099
020700 MOVE "WRITE THE CAR MODEL IN THE DATA FIELD" TO MSGO. 02070099
020800 PERFORM 030-SEND-MAP. 02080099
020900 PERFORM 040-RECEIVE-MAP. 02090099
021000 MOVE INFOI TO CARMODEL. 02100099
021100 MOVE LOW-VALUES TO CARMAI, CARMAO. 02110099
021200 MOVE "WRITE THE LICENSE PLATE IN DATA FIELD" TO MSGO. 02120099
021300 PERFORM 030-SEND-MAP. 02130099
021400 PERFORM 040-RECEIVE-MAP. 02140099
021500 MOVE INFOI TO REGISTRATION. 02150099
021600 MOVE LOW-VALUES TO CARMAI, CARMAO. 02160099
021700 MOVE "WRITE THE NAME OF THE CLIENT IN DATA FIELD" TO MSGO. 02170099
021800 PERFORM 030-SEND-MAP. 02180099
021900 PERFORM 040-RECEIVE-MAP. 02190099
022000 MOVE INFOI TO CLIENTNAME. 02200099
022010 MOVE LOW-VALUES TO CARMAI, CARMAO. 02201099
022100 MOVE "WRITE THE PHONE OF CLIENT IN THE DATA FIELD" TO MSGO. 02210099
022200 PERFORM 030-SEND-MAP. 02220099
022300 PERFORM 040-RECEIVE-MAP. 02230099
022400 MOVE INFOI TO CONTACT. 02240099
022410 MOVE LOW-VALUES TO CARMAI, CARMAO. 02241099
022500 MOVE "WRITE WHICH YEAR THE CAR WAS MADE DATA FIELD" TO MSGO. 02250099
022600 PERFORM 030-SEND-MAP. 02260099
022700 PERFORM 040-RECEIVE-MAP. 02270099
022800 MOVE INFOI TO PRODUCTIONYEAR. 02280099
022810 MOVE LOW-VALUES TO CARMAI, CARMAO. 02281099
022900 MOVE "WRITE THE MILEAGE IN THE DATA FIELD" TO MSGO. 02290099
023000 PERFORM 030-SEND-MAP. 02300099
023100 PERFORM 040-RECEIVE-MAP. 02310099
023200 MOVE INFOI TO MILEAGE. 02320099
023210 MOVE LOW-VALUES TO CARMAI, CARMAO. 02321099
023300 MOVE "WRITE THE PRICE OF THE CAR IN DATA FIELD" TO MSGO. 02330099
023400 PERFORM 030-SEND-MAP. 02340099
023500 PERFORM 040-RECEIVE-MAP. 02350099
023600 MOVE INFOI TO CARPRICE. 02360099
023700 EXEC CICS WRITE 02370099
023800 FILE('CAR') 02380099
023900 FROM(REGISTO) 02390099
024000 LENGTH(WS-LEN) 02400099
024010 RIDFLD(CARNO) 02401099
024100 RBA 02410099
024200 END-EXEC. 02420099
024210 ADD 1 TO CAR-COUNT. 02421099
024300* CLOSE CAR. 02430099
024400 060-SHOW-RECORDS. 02440099
024500* OPEN INPUT CAR 02450099
024501 MOVE WS-LEN TO WS-KEY-LEN. 02450199
024510 MOVE 0 TO CARNO. 02451099
024600 EXEC CICS STARTBR 02460099
024700 FILE('CAR') 02470099
024800 RIDFLD(CARNO) 02480099
024810 RBA 02481099
024900 END-EXEC. 02490099
025000 PERFORM UNTIL FS-CAR-EOF 02500099
025100 EXEC CICS READNEXT 02510099
025200 FILE('CAR') 02520099
025300 INTO(REGISTO) 02530099
025310 LENGTH(WS-LEN) 02531099
025320 RIDFLD(CARNO) 02532099
025330 RBA 02533099
025400 END-EXEC 02540099
026000 ADD 1 TO READ-COUNT 02600099
026001 MOVE LOW-VALUES TO CARMAI, CARMAO 02600199
026002 MOVE WS-NAMEDAY TO WS-MESSAGE (1:10) 02600299
026003 MOVE ', ' TO WS-MESSAGE (11:3) 02600399
026004 MOVE WS-DATE TO WS-MESSAGE (14:10) 02600499
026005 MOVE WS-MESSAGE TO CDAYO 02600599
026010 MOVE 'READING RECORDS IN FILE' TO MSGO 02601099
026100 MOVE DATESOLD TO SALEO 02610099
026200 MOVE CARBRAND TO BRANDO 02620099
026500 MOVE CARMODEL TO MODELO 02650099
026600 MOVE REGISTRATION TO PLATEO 02660099
026900 MOVE CLIENTNAME TO CLIENTO 02690099
027000 MOVE CONTACT TO PHONEO 02700099
027300 MOVE PRODUCTIONYEAR TO CREATO 02730099
027400 MOVE MILEAGE TO MILESO 02740099
027700 MOVE CARPRICE TO PRICEO 02770099
027800 PERFORM 030-SEND-MAP 02780099
027900 END-PERFORM. 02790099
028000* CLOSE CAR. 02800099
------------------------------------------------------>END OF COBOL Program