I've got a set of execs <http://www.cbttape.org/ftp/cbt/CBT769.zip> that convert "legacy" languages into fancy HTML and optionally transfer the result of the conversion to a PC and start a browser.

Recently someone told me that this latter functionality is broken, and after some investigation it seems that the old method of connecting to the WSA, i.e.

"ispexec select pgm(ispwscd) parm(wscon,panel)"

no longer works, although looking at the ISPCMDS command table, this is exactly the action for the WSCON verb.

The new method, skeleton X3 tells me to use

"ispexec wscon ip(ipaddr) title(title) codepage(1140) " ||,
              "charset(0695) noguidsp panel(onerror)"

with "ipaddr" and "title" containing an IP address and a string of max 64 characters.

When I tried this in a simple exec, i.e.

/* REXX */
h = "'prino.#s0c7.exec.html'"
w = 'd:\#s0c7.exec.html'       /* Will start Firefox on doze */

connected     = 0
was_connected = 0

/* Is user already connected to workstation? */
"ispexec vget (zwscon) shared"
if rc     = 8 |,
   zwscon = '' then
  do
    was_connected = 0

    /* Start connection and check that we're really connected */
    ip    = '192.168.1.2'
    title = 'Prino'
    "ispexec wscon ip(ip) title(title) codepage(1140) " ||,
        "charset(0695) noguidsp panel(onerror)"

    if rc = 0 then
      connected = 1
  end
else
  do
    connected     = 1
    was_connected = 1
  end

/* Issue message if still no connection exists */
if connected = 0 then
  "ispexec setmsg msg(ispp605)"
else
  do
    "ispexec filexfer host(h) ws(w) to(ws) text"
    "ispexec select wscmd("w") modeless min invis"

    /* Only close connection to the workstation if it hadn't been
       estabished before this exec */
    if was_connected = 0 then
      "ispexec wsdiscon"
  end

the code works flawlessly, but when I put the following code replacement code inside EHISUPP (from the above archive on the CBT Tape site),

/***********************************************************************
* XFER_AND_SHOW_HTML:                                                  *
*                                                                      *
* Transfer the html file to the PC via ISPF Workstation Agent and      *
* start the application associated with extension .html                *
***********************************************************************/
xfer_and_show_html:
  parse value data with sep ',' dir_pc (sep),
                                htmlfile (sep),
                                odsn (sep),
                                start_browser

  /*********************************************************************
  * Format the name of the html file for PC                            *
  *********************************************************************/
  if right(dir_pc, 2) \= ':\' then
    dir_pc = strip(dir_pc, 'T', '/') || '/'

  w = dir_pc || htmlfile

  connected     = 0
  was_connected = 0

  /*********************************************************************
  * Is user already connected to workstation?                          *
  *********************************************************************/
  "ispexec vget (zwscon) shared"
  if rc     = 8 |,
     zwscon = '' then
    do
      was_connected = 0

      /*****************************************************************
      * Start connection and check that we're really connected         *
      *****************************************************************/
      title = strip(left(htmlfile, 64))

      ip = '192.168.1.2'             /* >> Use your own IP address << */

      "ispexec wscon ip(ip) "         ||,
                    "title(title) "   ||,
                    "codepage(1140) " ||,
                    "charset(0695) "  ||,
                    "noguidsp "       ||,
/*                  "panel(yes)"      /* OK     */
                    "panel(no)"       /* RC = 8 */
*/                  "panel(onerror)"  /* RC = 8 */

      if rc = 0 then
        connected = 1
    end
  else
    do
      connected     = 1
      was_connected = 1
    end

  /*********************************************************************
  * Issue message if still no connection exists                        *
  *********************************************************************/
  if connected = 0 then
    "ispexec setmsg msg(ispp605)"
  else
    do
      h = odsn

      /*****************************************************************
      * Put filenames in the ISPF pool & transfer file to PC           *
      *****************************************************************/
      "ispexec filexfer host(h) ws(w) to(ws) text"

      /*****************************************************************
      * and optionally start the corresponding browser                 *
      *****************************************************************/
      if translate(left(start_browser, 1)) = 'Y' then
        "ispexec select wscmd("w") modeless min invis"

      /*****************************************************************
      * Only close connection to the workstation if it hadn't been     *
      * estabished before this exec                                    *
      *****************************************************************/
      if was_connected = 0 then
        "ispexec wsdiscon"
    end
return 0

with a hard-coded valid IP address, I get an RC=8, which, according to the ISPF model means:

USER HIT END, EXIT, OR CANCEL FROM THE 'INITIATE WORKSTATION CONNECTION' PANEL WITHOUT MAKING A CONNECTION.

** Except for the fact that I do not even see a panel... **

Changing the command to "PANEL(NO)" will also RC=8, and using "PANEL(YES)" will
show the panel, with whatever IP address was there and Enter will connect to the
WSA, the transfer will be done and the browser will be started (or whatever other application is associated with the extension of the file), but that requires manual interventions, which is what I do not want.

So what the fluffing 'ell am I doing wrong?

Problem two is the required settings on the wscon command of code page and character set. ISPF runs with a ZTERMCP 0f 1047 and a ZTERMCS of 697 and doing a standard FTP from z/OS to doze of the generated HTML file, which contains a number of non-codepage-invariant characters, yes, '[' and ']' (and possibly more) gives me clean HTML file on the PC. However, using the above settings of the WSCON command, i.e. codepage(1140) & charset(0695), the '[' are translated to ASCII 221 and the ']' to ASCII 168, which screws up the //<![CDATA[ and //]]> bracketing the Javascript that takes care of the sequence numbers and resizing. What do I use to get these two characters to transfer the way they should transfer?

Any suggestions would be most welcome.

Robert
--
Robert AH Prins
robert(a)prino(d)org

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to