View previous topic :: View next topic
|
Author |
Message |
deboshree
New User
Joined: 13 Mar 2007 Posts: 10 Location: pune
|
|
|
|
I am using a vsam file and reading the records using the the following key field .
05 SID01-KEY-DATA.
10 SID01-CIMS-GROUP PIC X(08).
10 SID01-KEY-MAIN.
15 SID01-CIMS-EA PIC X(08).
The program is not reading the records and showing an file status '23'
kindly help regarding the following issue |
|
Back to top |
|
|
deboshree
New User
Joined: 13 Mar 2007 Posts: 10 Location: pune
|
|
|
|
The program is not able to read vsam records in process-sid- file
Code: |
MAIN-CONTROL.
PERFORM OPEN-INITIALIZE.
READ SID-INPUT-FILE.
PERFORM PROCESS-SID-FILE
UNTIL SID01-STATUS = '10'.
PERFORM CLOSE-PARA.
PROCESS-SID-FILE.
IF SID01-STATUS NOT = '00' OR '10'
DISPLAY 'UNSUCCESSFUL READ OF SID-INPUT-FILE'
DISPLAY 'KEY=' SID01-KEY-DATA
DISPLAY 'STATUS ='SID01-STATUS
PERFORM ABORT-PROGRAM
END-IF.
IF SID01-STATUS NOT = '10'
IF SID01-CIMS-GROUP NOT = SID01-CIMS-EA
DELETE SID-INPUT-FILE
IF SID01-STATUS NOT = '00'
DISPLAY 'BAD DELETE RECORD'
DISPLAY ' KEY = 'SID01-KEY-DATA
DISPLAY ' STATUS = 'SID01-STATUS
PERFORM ABORT-PROGRAM
END-IF
END-IF
END-IF.
READ SID-INPUT-FILE. |
Thanks |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
Since a '23' is :
An attempt was made to randomly access a record that does not exist in the file, or a START or random READ statement was attempted on an optional input file that was not present.
You are leaving something out of your post. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Has the compiler been changed to accomodate not/or? Is the posted code the actual code or is it re-phrased for posting?
This has caused problems for many:
Code: |
IF SID01-STATUS NOT = '00' OR '10' |
Everything will fail - zero is not= ten and ten is not= zero and everything else will be not= zero. . . .
A way to code this is:
Code: |
IF SID01-STATUS NOT = '00' AND
SID01-STATUS NOT = '10' |
Please post any actual error messages. Also, please post the SELECT. |
|
Back to top |
|
|
deboshree
New User
Joined: 13 Mar 2007 Posts: 10 Location: pune
|
|
|
|
i have done the above mentioned changes but still the program is not able to read the input file (vsam) which has been created manualy.
the task was to read a input file if the key and other field do not match delete.
and hence the following program.
i have displayed the key but it is not displaying it in sysout.
Code: |
FILE-CONTROL.
SELECT SID-INPUT-FILE
ASSIGN TO SID01INS
ORGANIZATION IS INDEXED
ACCESS IS RANDOM
RECORD KEY IS SID01-KEY-DATA OF SID01-RECORD
FILE STATUS IS SID01-STATUS.
DATA DIVISION.
FILE SECTION.
FD SID-INPUT-FILE
DATA RECORD IS SID01-RECORD.
COPY SID01PCB.
WORKING-STORAGE SECTION.
01 WS-FILE-STATUS.
03 SID01-STATUS PIC XX.
01 WS-ABEND-CODE PIC S9(04) COMP VALUE +888.
PROCEDURE DIVISION.
MAIN-CONTROL.
PERFORM OPEN-INITIALIZE.
READ SID-INPUT-FILE.
PERFORM PROCESS-SID-FILE
UNTIL SID01-STATUS = '10'.
PERFORM CLOSE-PARA.
OPEN-INITIALIZE.
OPEN I-O SID-INPUT-FILE.
IF SID01-STATUS NOT = '00'
DISPLAY 'UNSUCCESSFUL- OPEN OF SID-INPUT-FILE'
DISPLAY 'KEY=' SID01-KEY-DATA
DISPLAY 'STATUS ='SID01-STATUS
PERFORM ABORT-PROGRAM
END-IF.
PROCESS-SID-FILE.
IF SID01-STATUS NOT = '00' OR '10'
IF SID01-STATUS NOT = '00' AND
SID01-STATUS NOT = '10'
DISPLAY 'UNSUCCESSFUL READ OF SID-INPUT-FILE'
DISPLAY 'KEY=' SID01-KEY-DATA
DISPLAY 'STATUS ='SID01-STATUS
PERFORM ABORT-PROGRAM
END-IF.
IF SID01-STATUS NOT = '10'
IF SID01-CIMS-GROUP NOT = SID01-CIMS-EA
DELETE SID-INPUT-FILE
IF SID01-STATUS NOT = '00'
DISPLAY 'BAD DELETE RECORD'
DISPLAY ' KEY = 'SID01-KEY-DATA
DISPLAY ' STATUS = 'SID01-STATUS
PERFORM ABORT-PROGRAM
END-IF
END-IF
END-IF.
READ SID-INPUT-FILE.
ABORT-PROGRAM.
DISPLAY ' '.
DISPLAY '** PROGRAM ABORTED **'.
CALL 'ILBOABN0' USING WS-ABEND-CODE.
CLOSE-PARA.
CLOSE SID-INPUT-FILE.
IF SID01-STATUS NOT = '00'
DISPLAY ' ERROR CLOSING SID INPUT FILE'
DISPLAY 'STATUS IS ', SID01-STATUS
END-IF. |
error message : in sysout
UNSUCCESSFUL READ OF SID-INPUT-FILE
KEY=
STATUS =23
** PROGRAM ABORTED **
CEE3250C The system or user abend U 888 R=00000000 was issued. |
|
Back to top |
|
|
deboshree
New User
Joined: 13 Mar 2007 Posts: 10 Location: pune
|
|
|
|
kindly provide help regarding the above issue.
thanks |
|
Back to top |
|
|
muthuvel
Active User
Joined: 29 Nov 2005 Posts: 217 Location: Canada
|
|
|
|
Deboshree,
From your above code,You are reading the input VSAM file and processing it sequentially.
These are my assumptions:
If you are reading it sequentially,the first record in the VSAM is low values.So you are not getting the value in display.Hence perform solution 1 and let us know.
Else If you are reading the VSAM randomly,then my guess is you have not given the key value to the VSAM read.
Check the code.
These are my probable solutions:
1)If it is a sequential VSAM read ,move low values to the VSAM key and perform a READ-NEXT,so that first data record is read.
2)If it is a random read,pass the data properly and recheck/trace the code
Corrections are Welcomed |
|
Back to top |
|
|
deboshree
New User
Joined: 13 Mar 2007 Posts: 10 Location: pune
|
|
|
|
i used the first approach and it is working but still the program is abending .
the sys out:UNSUCCESSFUL READ OF SID-INPUT-FILE
KEY=1111111111111111
STATUS =00
i moved low values to vsam key
01 WS-NULL-FIELD.
05 WS-KEY-DATA.
10 WS-CIMS-GROUP PIC X(08) VALUE SPACES.
10 WS-CIMS-EA PIC X(08) VALUE SPACES.
Before reading the records.
READ SID-INPUT-FILE.
MOVE WS-NULL-FIELD TO SID01-KEY-DATA.
START SID-INPUT-FILE
KEY IS GREATER THAN SID01-KEY-DATA.
thanks |
|
Back to top |
|
|
agkshirsagar
Active Member
Joined: 27 Feb 2007 Posts: 691 Location: Earth
|
|
|
|
Add STOP RUN in the position shown below.
Code: |
MAIN-CONTROL.
PERFORM OPEN-INITIALIZE.
READ SID-INPUT-FILE.
PERFORM PROCESS-SID-FILE
UNTIL SID01-STATUS = '10'.
PERFORM CLOSE-PARA.
STOP RUN.
OPEN-INITIALIZE.
OPEN I-O SID-INPUT-FILE.
IF SID01-STATUS NOT = '00'
DISPLAY 'UNSUCCESSFUL- OPEN OF |
Or the problem could be with file data. Please post some data of the file if problem persists. |
|
Back to top |
|
|
deboshree
New User
Joined: 13 Mar 2007 Posts: 10 Location: pune
|
|
|
|
1111111111111111
1111111122222222
2222222211111111
2222222222222222
3333333311111111
3333333322222222
some data.
can anyone let the syntax of read next in vsam
thanks |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
Look at this, "unsuccessful read" and "status=00" at the same time, amazing
deboshree wrote: |
the sys out:UNSUCCESSFUL READ OF SID-INPUT-FILE
KEY=1111111111111111
STATUS =00 |
If you would correct the IF like Dick asked you to so long ago, you might find that it is working fine.
Code: |
PROCESS-SID-FILE.
IF SID01-STATUS NOT = '00' OR '10'
IF SID01-STATUS NOT = '00' AND
SID01-STATUS NOT = '10'
DISPLAY 'UNSUCCESSFUL READ OF SID-INPUT-FILE'
DISPLAY 'KEY=' SID01-KEY-DATA
DISPLAY 'STATUS ='SID01-STATUS
PERFORM ABORT-PROGRAM
END-IF. |
|
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
You must remove this:
Code: |
IF SID01-STATUS NOT = '00' OR '10' |
It will always fail. That is why i posted alternative code. |
|
Back to top |
|
|
deboshree
New User
Joined: 13 Mar 2007 Posts: 10 Location: pune
|
|
|
|
thanks a lot to all of u and dick really i missed out on ur valuable advice
after the change the program ran successfully.
sorry for taht.
thanks |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
You're welcome
Not to worry - we're here if you have questions. |
|
Back to top |
|
|
|