You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I trying to read a file and writing it to another file.
My program:
from pyzfile import *
def main():
print("Read MVS-file")
outfile = ZFile("//'BC6608.TEST.QSAMOUT'","w,type=record,seek",encoding='cp1047')
print(outfile.info())
try:
with ZFile("//'BC6608.TEST.QSAM'","rb,type=record",encoding='cp1047') as infile:
for rec in infile:
print(rec)
except ZFileError as e:
print(e)
print(outfile.info())
print(infile.info())
print(file.info())
print("All records read")
And if I add a outfile.write(rec) after the 'print(rec)' I will get an error:
raise Exception(f"Error writing to file 'æself.filenameå': æself.lib.zfile_strerror().decode('utf-8')å")
Exception: Error writing to file '//'BC6608.TEST.QSAMOUT'': EDC5113I Bad file descriptor.
The files are nothing special:
Organization . . . : PS Current Utilization
Record format . . . : FB Used tracks . . . . : 2
Record length . . . : 80 Used extents . . . : 1
Block size . . . . : 27920
1st extent tracks . : 15
Secondary tracks . : 15 Dates
Data set name type : Creation date . . . : 2023/12/20
Data set encryption : NO Referenced date . . : 2023/12/20
Expiration date . . : None
SMS Compressible . : NO
Am I doing anything wrong?
BR
Frank Allan Rasmussen
The text was updated successfully, but these errors were encountered:
Hi
I trying to read a file and writing it to another file.
My program:
from pyzfile import *
def main():
print("Read MVS-file")
outfile = ZFile("//'BC6608.TEST.QSAMOUT'","w,type=record,seek",encoding='cp1047')
print(outfile.info())
try:
with ZFile("//'BC6608.TEST.QSAM'","rb,type=record",encoding='cp1047') as infile:
for rec in infile:
print(rec)
except ZFileError as e:
print(e)
print(outfile.info())
print(infile.info())
print(file.info())
print("All records read")
if name == "main":
main()
The first print(outfile.info()) returns:
æ'access_method': 'UNSPEC', 'blksize': 4294967295, 'device': '', 'dsname': '', 'dsorgConcat': False, 'dsorgHFS': False, 'dsorgHiper': False, 'dsorgMem': False,'dsorgPDE': False, 'dsorgPDSdir': False, 'dsorgPDSmem': False, 'dsorgPO': False, 'dsorgPS': False, 'dsorgTemp': False, 'dsorgVSAM': False, 'maxreclen': 343758143136, 'mode': æ'append': False, 'read': False, 'update': False, 'write': Falseå, 'noseek_to_seek': 'NOSWITCH', 'openmode': 'TEXT', 'recfmASA': False, 'recfmB':False, 'recfmBlk': False, 'recfmF': False, 'recfmM': False, 'recfmS': False, 'recfmU': False, 'recfmV': False, 'vsamRKP': 343740737584, 'vsamRLS': 'NORLS', 'vsamkeylen': 471371242, 'vsamtype': 'NOTVSAM'å
So no dsname.
And if I add a outfile.write(rec) after the 'print(rec)' I will get an error:
raise Exception(f"Error writing to file 'æself.filenameå': æself.lib.zfile_strerror().decode('utf-8')å")
Exception: Error writing to file '//'BC6608.TEST.QSAMOUT'': EDC5113I Bad file descriptor.
The files are nothing special:
Organization . . . : PS Current Utilization
Record format . . . : FB Used tracks . . . . : 2
Record length . . . : 80 Used extents . . . : 1
Block size . . . . : 27920
1st extent tracks . : 15
Secondary tracks . : 15 Dates
Data set name type : Creation date . . . : 2023/12/20
Data set encryption : NO Referenced date . . : 2023/12/20
Expiration date . . : None
SMS Compressible . : NO
Am I doing anything wrong?
BR
Frank Allan Rasmussen
The text was updated successfully, but these errors were encountered: