GithubHelp home page GithubHelp logo

pyzfile's People

Contributors

daveyc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

gchacko

pyzfile's Issues

write() function with encoding="cp1047" uses wrong code points for square brackets

Writing records to a z/OS PDS member the square bracket characters are stored as X'BA' and X'BB' rather than X'AD' and X'BD'.

I haven't checked the other "problematic" characters yet (cent sign, not sign, caret, unbroken and broken vertical bars).

It is kind of difficult to write json output to a z/OS file without the correct square bracket characters. Is there any other encoding that will give correct square brackets in a z/OS file?

Using 2 files in one python script

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

Install for those without internet connection

I was asked how someone installs this if they cannot use pip on z/OS.

They managed it by

I managed to install it by downloading the zip file, uploading it to the zOS LPAR, unzipping it and then running the pip program against the pyzfile-1.0.0.post2-py3-none-any.whl in the pyzfile/dist folder.

It would be worth adding some words like this to this documentation
Colin

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.