0

I'm having issues uploading .html files to our z/OS USS environment - specifically character set and code page conversions.

I telnet in with PuTTy, upload with WinSCP, and edit with Notepad++, but have the strange situation whereby I can have a USS shell session going and can CAT and VI a file and if it looks OK, it'll be displayed by the z/OS web server OK, but then if I try to edit it from WinSCP, I just get garbage:

LZÄÖÃãè×Å@ˆ£”“nLˆ£”“@n@@Lˆ…„n@@@@L”…£@ƒˆ™¢…£~äãÆ`øn@@@@L£‰£“…nÃÉÃâ@

similarly, if it looks OK in Notepad++ then it'll look like garbage when served as a web page.

I have the text file traansfer options on and if I list the files in aa shell session I get:

t UTF-8       T=on  -rw-r--r--   1 JOCS065  JOCS2       9824 Jul 30 14:45 JS_Graphviz.html
t UTF-8       T=on  -rw-r--r--   1 JOCS065  JOCS2      29370 Jul 30 14:15 JS_Graphviz_new.html

JS_Graphviz.html won't show as a webpage but JS_Graphviz_new.html will.

Both have <meta charset="utf-8">, notepad++ shows both as ANSI.

Oddly, if I take the good code from Notepad++, and then edit the same file in vi via my shell session, delete everything and paste in the code I copied from Notepad++, it can then be served by the web server (and look like garbage in NPP etc).

So there's obviously some hidden flag or setting for the code page or character set. Does anyone have a rock-solid editing solution for text files in USS on z/OS?

EDIT

Screenshot showing errors with JavaScript files

Chrome Inspect window

Steve Ives
  • 7,894
  • 3
  • 24
  • 55
  • How are you connecting with WinSCP? SFTP or FTPS? I suspect the former. – Kevin McKenzie Jul 30 '19 at 14:52
  • @KevinMcKenzie Yep - SFTP – Steve Ives Jul 30 '19 at 15:00
  • [This](https://superuser.com/a/1464822/535125) answer on SE superuser may help. There are features in the z/OS OpenSSH port and Dovetailed Technologies Co:Z SFTP server that may help. – cschneid Jul 30 '19 at 16:26
  • 1
    The `LZÄÖÃãè×Å@ˆ£”“nLˆ£”“@n@@Lˆ…„n@@@@L”…£@ƒˆ™¢…£~äãÆ`øn@@@@L£‰£“…nÃÉÃâ@` is ebcdic text displayed as ascii. If you edit as ebcdic (I used JEdit and specified IBM037 as the font, you get: ** CICS** – Bruce Martin Jul 30 '19 at 23:16
  • @BruceMartin Thanks Bruce. So I've managed to get my main HTML page to display, but still having issues with the JavaScript files, which are displaying normally via 'cat' or Notepad++ or 'vi' etc, but are - despite all my efforts - being processed as EBCIDIC in the browser (screenshot attached to question)) – Steve Ives Jul 31 '19 at 10:32

2 Answers2

1

I'm going to go ahead and answer, though this could be wrong. This is known SCP behavior. How can I convince z/OS scp to transfer binary files?. If you connect via FTP or FTPS, you should get the behavior you expect. Or you can try using code tagging, although that's beyond my scope of knowledge. See https://www.ibm.com/support/knowledgecenter/en/SSLTBW_2.1.0/com.ibm.zos.v2r1.bpxa400/bpxug294.htm.

Kevin McKenzie
  • 627
  • 3
  • 18
1

In general my experience is that when environment variable _BPXK_AUTOCVT=ON you'll get auto conversion under the covers. See this article to get better insight on how this process works and adjust for your workflow:

_BPXK_AUTOCVT

Used when enabling automatic conversion of tagged files. When set, this variable overrides the AUTOCVT setting in BPXPRMxx.

For fork (BPX1FRK/BPX4FRK), spawn (BPX1SPn/BPX4SPN), exec (BPX1EXC/BPX4EXC), and pthread_create (BPX1PTC/BPX4PTC), _BPXK_AUTOCVT is propagated from the parent to the child. For pthread_create, the parent is the Initial Program Task (IPT).

ON

Activates the automatic file conversion of tagged files. This option affects conversion for I/O for regular, pipe, and character-special files that are tagged.

OFF

Deactivates the automatic file conversion of tagged files. OFF is the default.

ALL

Activates the automatic conversion of tagged files that are supported by Unicode Services. This option affects conversion for I/O for regular and pipe files that are tagged. Setting or unsetting ALL has no effect after translation for a file begins. If the conversion is between EBCDIC and ASCII, this option also affects conversion for I/O for character special files.

https://www.ibm.com/support/knowledgecenter/en/SSLTBW_2.3.0/com.ibm.zos.v2r3.bpxb200/bpxkenv.htm

Community
  • 1
  • 1
Hogstrom
  • 3,581
  • 2
  • 9
  • 25