URI protocol for MVS datasets

General discussion on the JZOS batch launcher and toolkit
Post Reply
RSchoen
Posts: 1
Joined: Wed Oct 30, 2019 10:36 am

URI protocol for MVS datasets

Post by RSchoen »

Is it possible to use reference a MVS file using a URI?

I'm using java 8 64bit on USS and am using Saxon to transform some xml documents.

My xsl doc includes others using xsl import:
e.g. <xsl:import href="translate.xsl"/>

I'm able to reference USS files using the file protocol.
e.g. "file:/tmp/translate.xsl"

I'm able to reference files contained within jars on the classpath using:
e.g. "classpath:translate.xsl"

To access MVS datasets I was hoping to perhaps see a ZFILE protocol
e.g. "zfile://DD:ddname"
And "zfile://'mvs filename'"

I did find some hints that it might be possible in this post
http://community.dovetail.com/forum/viewtopic.php?t=872

It makes reference to setting the protocol handler to some jzos specific ones.
Required for the zfile:// URL handler:
-Djava.protocol.handler.pkgs=com.dovetail.jzos.url
-Djava.protocol.handler.pkgs=com.ibm.jzos.url

I have tried out these options but haven't had any luck the URI just goes unresolved with an Invalid URI Exception.

I have looked through ibmjzos.jar but have been unable to locate the package handlers or other classes that seem to relate to URI / URL handling.

I have considered writing my own custom protocol and handler etc. It's new to me so if it already exists or someone else has something they would be willing to share that would be greatly appreciated.

Thank you
dovetail
Site Admin
Posts: 2025
Joined: Thu Jul 29, 2004 12:12 pm

Re: URI protocol for MVS datasets

Post by dovetail »

Hi,

If you download and install our TZ:QuickStart for Tomcat distribution here:
https://dovetail.com/downloads/tomcat/index.html

then you will find that we included a jar "jzos-url.jar" which include a package "com.dovetail.jzos.url". This has the Java protocol handler.
You can use this Jar in your application.
You would need to set "-Djava.protocol.handler.pkgs=com.dovetail.jzos.url" just as we do in the Tomcat "TCENV" JCL member.
If you look at the sample XML that we provide for TZ:Tomcat, you will see "zfile:" URL references that use this protocol handler.

See the Oracle documentation for "java.protocol.handler.pkgs" for more information. I am assuming that the version of Saxon that you are using will support this, but you should check.
Post Reply