.st0{fill:#FFFFFF;}

Ignore naughty special characters- Java and IBMi might get upset! 

 March 28, 2016

By  NickLitten

Naughty Special Characters – from Dollars to Pounds. Another IBM I Developer was having this weird problem with an IFS file. Trying to figure out the code page problems with a file that had been emailed from a British IBM i Server. naughty special characters- Java and IBMi might get upset!

When the Java QSHELL command is run to UNZIP (jar) from a CLLE program like this:

QSH CMD('jar cvfM NAS_TMP/$.SAVF/QSYS.LIB/NAS_TMP.LIB/$.FILE')

but I receive this error : Premere INVIO per chiudere la sessione del terminale. /QSYS.LIB/NAS_TMP.LIB/675SAVE.FILE : impossible to find file or directory My JOB CCSID is 280 , i have also tried to change to 37 but always get same error

I hate code pages.

I mean I dont hate them, they are good and useful but damn they annoy me when I get them wrong šŸ˜‰

In this case the solution was straight forward.:

The $$ in Qshell means “insert current process id here”. That’s why when you specified /QSYS.LIB/NAS_TMP.LIB/$.FILE’, it gave an error message referring to /QSYS.LIB/NAS_TMP.LIB/675SAVE.FILE, because 675 must’ve been your process id (pid) at the time you ran this, so it replaced $$ with 675. To avoid this, you must escape the $$ so that it does not have a special meaning. An easy way to do that is to put the path names in single quotes, for example:

QSH CMD(‘jar cvfM ”NAS_TMP/$.SAVF” ”/QSYS.LIB/NAS_TMP.LIB/$.FILE”’)

The best solution in the long run is to stop using special characters like $, @ and # in your object names.

This has always been a bad way to do this, it makes the names more arcane looking, has problems when switching between character sets used in different countries, and conflicts with environments such as QShell, PHP, perl, etc. Much better to stop doing things that way!

NickLitten


IBM i Software Developer, Digital Dad, AS400 Anarchist, RPG Modernizer, Shameless Trekkie, Belligerent Nerd, Englishman Abroad and Passionate Eater of Cheese and Biscuits. Nick Litten Dot Com is a mixture of blog posts that can be sometimes serious, frequently playful and probably down-right pointless all in the space of a day. Enjoy your stay, feel free to comment and remember: If at first you don't succeed then skydiving probably isn't a hobby you should look into.

Nick Litten

related posts:

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}
__CONFIG_colors_palette__{"active_palette":0,"config":{"colors":{"cff50":{"name":"Main Accent","parent":-1},"a344d":{"name":"Accent Transparent","parent":"cff50"}},"gradients":[]},"palettes":[{"name":"Default","value":{"colors":{"cff50":{"val":"var(--tcb-skin-color-0)"},"a344d":{"val":"rgba(46, 138, 229, 0.85)","hsl_parent_dependency":{"h":210,"l":0.54,"s":0.78}}},"gradients":[]},"original":{"colors":{"cff50":{"val":"rgb(0, 178, 255)","hsl":{"h":198,"s":1,"l":0.5}},"a344d":{"val":"rgba(0, 178, 255, 0.85)","hsl_parent_dependency":{"h":198,"s":1,"l":0.5}}},"gradients":[]}}]}__CONFIG_colors_palette__

Get In Touch

Iā€™m always looking for awesome input, feedback and critique!

>