chtag does not work on z/OS UNIX











up vote
2
down vote

favorite












I'm trying to tag ASCII files on z/OS host shell, so we do not have to specify the code page on the command line.



> echo > iso.txt
> chtag -t -c 819 iso.txt
> vi iso.txt


Type in "Hello" then quit and save



> ls -T iso.txt
t ISO8859-1 T=on iso.txt
> od -x iso.txt
0000000000 C885 9393 9615


examining the iso.txt file shows it contains EBCDIC.



How do I set the tools to make use of the code page tag attribute? Note that explicitly specifying the code page using -W filecodeset=819 works.










share|improve this question




























    up vote
    2
    down vote

    favorite












    I'm trying to tag ASCII files on z/OS host shell, so we do not have to specify the code page on the command line.



    > echo > iso.txt
    > chtag -t -c 819 iso.txt
    > vi iso.txt


    Type in "Hello" then quit and save



    > ls -T iso.txt
    t ISO8859-1 T=on iso.txt
    > od -x iso.txt
    0000000000 C885 9393 9615


    examining the iso.txt file shows it contains EBCDIC.



    How do I set the tools to make use of the code page tag attribute? Note that explicitly specifying the code page using -W filecodeset=819 works.










    share|improve this question


























      up vote
      2
      down vote

      favorite









      up vote
      2
      down vote

      favorite











      I'm trying to tag ASCII files on z/OS host shell, so we do not have to specify the code page on the command line.



      > echo > iso.txt
      > chtag -t -c 819 iso.txt
      > vi iso.txt


      Type in "Hello" then quit and save



      > ls -T iso.txt
      t ISO8859-1 T=on iso.txt
      > od -x iso.txt
      0000000000 C885 9393 9615


      examining the iso.txt file shows it contains EBCDIC.



      How do I set the tools to make use of the code page tag attribute? Note that explicitly specifying the code page using -W filecodeset=819 works.










      share|improve this question















      I'm trying to tag ASCII files on z/OS host shell, so we do not have to specify the code page on the command line.



      > echo > iso.txt
      > chtag -t -c 819 iso.txt
      > vi iso.txt


      Type in "Hello" then quit and save



      > ls -T iso.txt
      t ISO8859-1 T=on iso.txt
      > od -x iso.txt
      0000000000 C885 9393 9615


      examining the iso.txt file shows it contains EBCDIC.



      How do I set the tools to make use of the code page tag attribute? Note that explicitly specifying the code page using -W filecodeset=819 works.







      posix mainframe code-page zos






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 16 at 7:34









      Adam Limbert

      169112




      169112










      asked Oct 28 '16 at 15:26









      Stavr00

      29318




      29318






















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          4
          down vote



          accepted










          There are support mechanisms for doing auto conversion based on tagging. To do what you’re interested in, I replicated your scenario on my z/OS 2.3 system. To accomplish what you want you can set _BPXK_AUTOCVT=ON. I repeated the provided test case and then set _BPXK_AUTOCVT=ON to demonstrate the desired behaviour worked.



          $ echo > iso.txt
          $ chtag -t -c 819 iso.txt
          $ ls -T iso.txt
          t ISO8859-1 T=on iso.txt
          $ vi iso.txt (enter Hello, save then exit)
          $ od -x iso.txt
          0000000000 C885 9393 9615
          0000000006


          The word Hello is stored as EBCDIC despite having tagged the file as 819.

          Next, setting _BPXK_AUTOCVT=ON enables auto conversion.



          $ export _BPXK_AUTOCVT=ON
          $ echo > iso.txt
          $ chtag -t -c 819 iso.txt
          $ vi iso.txt (enter Hello, save then exit)
          $ od -X iso.txt
          0000000000 48656C6C 6F0A0000
          0000000006


          Here you can see that the auto-conversion function stored the text in the correct codeset.



          References:




          • IBM Doc on relevant Environment Variables

          • File Tagging and Conversion






          share|improve this answer























            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "3"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














             

            draft saved


            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1139999%2fchtag-does-not-work-on-z-os-unix%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            4
            down vote



            accepted










            There are support mechanisms for doing auto conversion based on tagging. To do what you’re interested in, I replicated your scenario on my z/OS 2.3 system. To accomplish what you want you can set _BPXK_AUTOCVT=ON. I repeated the provided test case and then set _BPXK_AUTOCVT=ON to demonstrate the desired behaviour worked.



            $ echo > iso.txt
            $ chtag -t -c 819 iso.txt
            $ ls -T iso.txt
            t ISO8859-1 T=on iso.txt
            $ vi iso.txt (enter Hello, save then exit)
            $ od -x iso.txt
            0000000000 C885 9393 9615
            0000000006


            The word Hello is stored as EBCDIC despite having tagged the file as 819.

            Next, setting _BPXK_AUTOCVT=ON enables auto conversion.



            $ export _BPXK_AUTOCVT=ON
            $ echo > iso.txt
            $ chtag -t -c 819 iso.txt
            $ vi iso.txt (enter Hello, save then exit)
            $ od -X iso.txt
            0000000000 48656C6C 6F0A0000
            0000000006


            Here you can see that the auto-conversion function stored the text in the correct codeset.



            References:




            • IBM Doc on relevant Environment Variables

            • File Tagging and Conversion






            share|improve this answer



























              up vote
              4
              down vote



              accepted










              There are support mechanisms for doing auto conversion based on tagging. To do what you’re interested in, I replicated your scenario on my z/OS 2.3 system. To accomplish what you want you can set _BPXK_AUTOCVT=ON. I repeated the provided test case and then set _BPXK_AUTOCVT=ON to demonstrate the desired behaviour worked.



              $ echo > iso.txt
              $ chtag -t -c 819 iso.txt
              $ ls -T iso.txt
              t ISO8859-1 T=on iso.txt
              $ vi iso.txt (enter Hello, save then exit)
              $ od -x iso.txt
              0000000000 C885 9393 9615
              0000000006


              The word Hello is stored as EBCDIC despite having tagged the file as 819.

              Next, setting _BPXK_AUTOCVT=ON enables auto conversion.



              $ export _BPXK_AUTOCVT=ON
              $ echo > iso.txt
              $ chtag -t -c 819 iso.txt
              $ vi iso.txt (enter Hello, save then exit)
              $ od -X iso.txt
              0000000000 48656C6C 6F0A0000
              0000000006


              Here you can see that the auto-conversion function stored the text in the correct codeset.



              References:




              • IBM Doc on relevant Environment Variables

              • File Tagging and Conversion






              share|improve this answer

























                up vote
                4
                down vote



                accepted







                up vote
                4
                down vote



                accepted






                There are support mechanisms for doing auto conversion based on tagging. To do what you’re interested in, I replicated your scenario on my z/OS 2.3 system. To accomplish what you want you can set _BPXK_AUTOCVT=ON. I repeated the provided test case and then set _BPXK_AUTOCVT=ON to demonstrate the desired behaviour worked.



                $ echo > iso.txt
                $ chtag -t -c 819 iso.txt
                $ ls -T iso.txt
                t ISO8859-1 T=on iso.txt
                $ vi iso.txt (enter Hello, save then exit)
                $ od -x iso.txt
                0000000000 C885 9393 9615
                0000000006


                The word Hello is stored as EBCDIC despite having tagged the file as 819.

                Next, setting _BPXK_AUTOCVT=ON enables auto conversion.



                $ export _BPXK_AUTOCVT=ON
                $ echo > iso.txt
                $ chtag -t -c 819 iso.txt
                $ vi iso.txt (enter Hello, save then exit)
                $ od -X iso.txt
                0000000000 48656C6C 6F0A0000
                0000000006


                Here you can see that the auto-conversion function stored the text in the correct codeset.



                References:




                • IBM Doc on relevant Environment Variables

                • File Tagging and Conversion






                share|improve this answer














                There are support mechanisms for doing auto conversion based on tagging. To do what you’re interested in, I replicated your scenario on my z/OS 2.3 system. To accomplish what you want you can set _BPXK_AUTOCVT=ON. I repeated the provided test case and then set _BPXK_AUTOCVT=ON to demonstrate the desired behaviour worked.



                $ echo > iso.txt
                $ chtag -t -c 819 iso.txt
                $ ls -T iso.txt
                t ISO8859-1 T=on iso.txt
                $ vi iso.txt (enter Hello, save then exit)
                $ od -x iso.txt
                0000000000 C885 9393 9615
                0000000006


                The word Hello is stored as EBCDIC despite having tagged the file as 819.

                Next, setting _BPXK_AUTOCVT=ON enables auto conversion.



                $ export _BPXK_AUTOCVT=ON
                $ echo > iso.txt
                $ chtag -t -c 819 iso.txt
                $ vi iso.txt (enter Hello, save then exit)
                $ od -X iso.txt
                0000000000 48656C6C 6F0A0000
                0000000006


                Here you can see that the auto-conversion function stored the text in the correct codeset.



                References:




                • IBM Doc on relevant Environment Variables

                • File Tagging and Conversion







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Jul 8 at 4:13









                Scott

                15.4k113789




                15.4k113789










                answered Jul 8 at 3:16









                Hogstrom

                1,1421120




                1,1421120






























                     

                    draft saved


                    draft discarded



















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1139999%2fchtag-does-not-work-on-z-os-unix%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    AnyDesk - Fatal Program Failure

                    How to calibrate 16:9 built-in touch-screen to a 4:3 resolution?

                    QoS: MAC-Priority for clients behind a repeater