Unable to access PDS in z/OS unix shell

左心房为你撑大大i 提交于 2019-12-11 23:52:11

问题


I'm trying to copy a text file from within the z/OS unix shell to a PDS titled P2.OUTPUT($010), but whenever i run the command cp file.txt "//P2.OUTPUT($010)" i get an error stating that P2.OUTPUT(-sh10) is an invalid location. For whatever reason, whenever I run the command $010 becomes -sh10. I've tried putting $010 in '' and a few other things but no matter what I do it doesn't seem to work. I believe it's an issue with accessing the file and not with the cp command because I can't view the contents of the member using the cat command either, and any error trying to access the member using any command lists it as -sh10 instead of $010. Any idea what I'm doing wrong?


回答1:


The problem is that the unix shell interprets $0 as an environment-variable that has the value -sh as can be seen when using echo $0, so your command becomes cp file.txt "//P2.OUTPUT(-sh10)".

Try escaping the $ using a backslash: cp file.txt "//P2.OUTPUT(\$010)".



来源:https://stackoverflow.com/questions/33001256/unable-to-access-pds-in-z-os-unix-shell

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!