Giter Site home page Giter Site logo

Comments (4)

kadler avatar kadler commented on May 30, 2024

The problem with the third one is the ? in the command string causing iCmd to think it's an output parameter. As a workaround, you can specify the execution mode:

# Two apostrophes - fail
itool.add(iCmd('cmd', "SNDMSG MSG('Howdy, y''all! How ''bout another aposterfee?') TOUSR(jyeung)", {'exec': 'cmd'}))

from python-itoolkit.

jkyeung avatar jkyeung commented on May 30, 2024

Interesting. So getting parameters back requires something called 'rexx' mode. Are there any other situations where one might want 'rexx' instead of 'cmd'? And I guess if your suggestion is to use 'cmd' mode, there isn't a way to escape question marks in case one needs both a literal question mark and an output parameter?

from python-itoolkit.

kadler avatar kadler commented on May 30, 2024

The only way to dynamically call a CL command with output parameters is to call it via REXX. AFAIK, it's much slower than calling directly, so I would suggest never to use it unless needed.

XMLSERVICE generates a REXX procedure on the fly, calls it, and parses its output. It's not very smart about it, so I suspect that any ? is interpreted as an output parameter. I could be wrong, though - it's hard to decipher this mess. FYI, Tony considered calling CL commands with output parameters a hack and something you should never do in production.

from python-itoolkit.

jkyeung avatar jkyeung commented on May 30, 2024

Well, fortunately, it's a rare CL command indeed which would require the ability to accept literal question marks as well as output parameters. Of course it would still be nice to have, but it's very low on my wish list. Closing.

If someone stumbling across this does happen to know a way to specify a literal question mark in 'rexx' mode, by all means, post a comment!

from python-itoolkit.

Related Issues (20)

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.