0

We have a VSAM (z/OS) file with text content. Am developing a java program to read and process this VSAM file using the IBM JZOS (FileFactory) library.

This development is happening using Eclipse in Windows platform.

I need to have the VSAM file in my windows machine to unit test my java code from my eclipse IDE.

Mainframe folks converted the VSAM file to a flat file (text file) and downloaded from mainframe to windows machine via FTP. But, when java code opens the file with proper encoding type, the characters read seem to be corrupted. For example character P is displayed as a special character which is neither a ASCII or EBCDIC representation of character P. I have verified with the hex value of that character as well.

How can i get the VSAM file to my windows machine without corrupting the content due to encoding differences between Mainframe and Windows ?

yathirigan
  • 5,619
  • 22
  • 66
  • 104
  • 1
    What sort of VSAM dataset? I can't see how exporting the file will assist in accessing the VSAM dataset itself, unless you mean that you want to process an exported version of the data, otherwise you'd need to use VSAM access routines (which wouldn't then work on exported flat files). How have the Mainframe folks created the flat file (again may well depend upon the type of VSAM file (KSDS, ESDS, RRDS or LDS (*order according to likeliehood of use, assuming production type environment*)))? – MikeT Aug 30 '17 at 02:29
  • was the file converted to Ascii when it was FTP'd; Are you reading an Ascii file with EBCDIC encoding (or the reverse), this would give the errors you are reporting. – Bruce Martin Aug 30 '17 at 05:41
  • 2
    With out the file and Java code it is hard to work ou what what is going on – Bruce Martin Aug 30 '17 at 05:42
  • Can you provide the JCL that was used to convert the VSAM dataset? VSAM is not a file encoding; it's much more like a database, and there are a variety of different mechanisms for storing data in them. Depending on what they did, the data may or may not be what you're expecting. When you look at the flat file on the mainframe, what do you see? – Kevin McKenzie Aug 31 '17 at 01:10
  • 2
    Why are you trying to process a VSAM data set on Windows? If it's for no other reason then you're developing on Windows then that's not a good reason. I speak from experience because I've been down that path myself. The bottom line is if you're developing mainframe Java programs you should run those programs on the mainframe. I use Eclipse on windows with Maven and Git. When I've built on Windows I push to Git and then pull on z/OS. I then run Maven to build and run the unit tests. Rocket have [ported git to z/OS](http://www.rocketsoftware.com/zos-open-source/tools) which is free. – David Crayford Sep 07 '17 at 02:31
  • @DavidCrayford Thanks for this insight. Our developer machines are Windows and they use Eclipse in it. Currently they are using the ZFile class from the JZOS library which cannot be even unit tested in the developer's machine. Even a small logic change, the code has to be built using maven, pushed to z/OS and run from there. This was causing a huge additional overhead for our developers. But, with FileFactory, it is able to switch between java.io or ZFile internally based on the file being accessed, reducing developer overhead (during development) – yathirigan Sep 07 '17 at 02:59
  • 1
    IMO, you're making a rod for your back. FileFactory is fine for processing sequential files but what happens when you want to access the VSAM file directly, by key or RBA? The proof is in the pudding otherwise you wouldn't be posting this question. I suspect issues like this will be common. I also use RD/z which is an Eclipse based mainframe IDE. It can export java projects to the z/OS Unix file system with the click of a button. I don't see using that or Git as overhead. Also see Eclipse one click deploys using Ant [documented here](http://www.redbooks.ibm.com/redbooks/pdfs/sg247291.pdf). – David Crayford Sep 07 '17 at 03:23
  • @DavidCrayford since we are in PoC stage we are uncovering these challenges one by one. I was able to read VSAM files using FileFactory but, i guess our sample file isn't having any complex MF data types. Just yesterday I realized that the locate() method using the key has to be custom implemented when i use the FileFactory. RD/z had limited licenses but, i think this Ant document will be helpful for us to leverage Eclipse. Git is not supported here instead we have RTC. Do you have any blog or articles talking about your challenges/cautions from such a conversion ? Thank you very much :) – yathirigan Sep 07 '17 at 03:57
  • 1
    I work for a vendor so we probably don't face the same challenges as you. We were early adopters of Git. IIRC, I've seen a video on Youtube where IBM talk about integrating git with RTC. Our tool chain for developing Java for z/OS is pretty simple. Eclipse or RD/z, Git, Maven and puTTY for SSH shells. It's critical for us to deploy and test on z/OS because our product has native code written in C++/HLASM. We don't run JCL for tests just shell scripts. It's a good setup which gives us the best of both worlds. I'm a *nix guy so I don't like using the windows command shell as I don't know it. – David Crayford Sep 07 '17 at 04:33

0 Answers0