VSAM檔案IO操作返回碼參考

2021-04-17 13:10:19 字數 1996 閱讀 1290

vsam return codes

00   -  successful completion

02   -  duplicate key, non unique alt index

04   -  read, wrong length record 

05   -  open, file not present

10   -  end of file

20   -  invalid key vsam ksds or rrds

21   -  sequence error, on write or changing key on rewrite

22   -  duplicate key

23   -  record not found - (when we are trying to access a record with key)

orfile not found

35   -  open, file not present

when we will use this code in our program?

there are situations where file should be read if exists, write if it does not

when you dont know whether file exists are not , first you will open

file in i-o mode and check status code. if it is 35 then open that

file for output file. other wise you will continue with your logic

41   -  open, file is open 

42   -  close, file is closed 

43   -  delete or rewrite & no good read first

46   -  sequential read without positioning

47   -  reading file not open as input/io/extend

48   -  write without open in io mode

49   -  delete or rewrite without open in io mode

92   -  logic error/opening an open file 

or reading output file 

or write input file 

or del/rew but no prior read

94   -  sequential read after end of file 

or no current rec pointer for seq 

96   -  missing dd statement in jcl 

97  -  open ok, file integrity verified

when we will use this in our programs?

we use this code whenever we open the file, if status code is 00 or 97

we will proceed with our logic, other wise, call error routine.

usaully, it may come when file was not closed.

for example

if ws-file-status not = '00' and '97'

perform error-routine

end-if.

CICS返回碼參考

cics asra this abend occured beacuse of invalid non numeric data aica a looping task has been terminated with this abend code by cics because it was e...

檔案IO操作

在對乙個檔案或者裝置進行讀寫之前,都需要先開啟,以獲得該檔案或者裝置的操作指標,也就是檔案描述符。有了檔案描述符,後續就可以進行讀取,修改操作了。標頭檔案函式宣告 int open const char pathname,int flags,mode t mode 返回值成功 返回檔案描述符 失敗 ...

檔案操作IO

dup oldfd 和dup2 oldfd,newfd 這兩個函式我們可以用來複製檔案描述符。1 其中oldfd和newfd分別是複製前檔案描述符和複製後的檔案描述符。2 這兩個函式的呼叫都將複製檔案描述符oldfd,且他們的返回值都為新的檔案描述符。3 不同點是dup 的返回值是最小的未用檔案描述...