IBM MTM 2019: Part Two – Challenge #09

More about data sets and more Linux!

I’m on schedule! Last year I have only finished challenge 9 of part 2 on the fifth of october. This is day three 🙂 The blogs might lack in quality a bit but I’ll fix that once things have calmed down.

Promise!

Data Sets, Unix Files, and Character Encoding

IBM Master the Mainframe 2019 Part Two – Challenge #09

This challenge will be short and simple, just how we like it! Again, I’ll just list the commands and whether they are primary or line commands.

Use TSO Unix interface, OMVS, to edit Unix file and copy in data from an MVS data set

First we need to open OMVS using the primary command TSO OMVS. After that we issue the oedit ascii command to create and edit a new file called ascii.

After submitting the oedit ascii command we return to our familiar editor interface. Inhere we need to copy a file, we do that using copy ‘zos.mtm2019.public.iso8859’ as primary command.  To view the hexadecimal values we enter the primary command hex on.

Press F3 to save and return. Back inside the OMVS shell we type exit to exit back to the ISPF primary option menu.

Examine Unix File stream of bytes behavior

Well, they wanted us to go back to the ISPF primary option menu but now we need to go back? Whew. Let’s do that using TSO OMVS. Now we need to enter a sequence of commands to view the ascii file we previously created. The commands are explained by IBM on the challenge page.

  1. ls -TH ascii
  2. cat ascii
  3. iconv -t IBM-1047 -f ISO8859-1 ascii | more

I have executed said commands but there is a problem with the file. iconv to EBCDIC did not recognize newline (nl x’15’) as a valid EBCDIC character.

Change a Unix file character encoding tag

We need to change the ascii file tag to EBCDIC using the z/OS Unix chtag command. We can verify the success of this command by checking the tag again using the ls -TH ascii command. I have found a good resource on tagging here.

chtag -t -c IBM-1047 christmas.recipes
the file christmas.recipes is tagged as an EBCDIC file. IBM-1047 is the code set for EBCDIC.

So I just need to change this command example to chtag -t -c IBM-1047 ascii and it should be ok. I’ll do that and check the tag. If you have the wrong tag, you can delete the tag using chtag -r ascii.

The tag looks good! Now we will list the tags of this file and pipeline it to a new file called taglist. We do that by using the ls -TH ascii > taglist command. We copy the contents of taglist by using the command cp taglist “//p2.output(#09)”. This copies the content from taglist to your ZOS environment, P2.OUPUT member #09.

I have copied the contents. Should we verify? Yes we should! exit omvs and navigate to our P2.OUTPUT(#09) member.

It’s there! We have changed the tag on the ascii file, piped the command output to taglist and then copied the content of taglist to our ZOS data member P2.OUTPUT(#09)!

16 thoughts on “IBM MTM 2019: Part Two – Challenge #09

  1. Hi Kevin,
    I have the problem by thy type “iconv -t IBM-1047 -f ISO8859-1 ascii | more”.
    “FSUM6180 file “|”: EDC5129I No such file or directory.
    iconv: FSUM6180 file “more”: EDC5129I No such file or directory. ”
    The file or the directory are not exit, do you know what the problem is?

    1. Hi Erko

      Can you verify that you have the file “ascii” in your current directory? You can do that by entering the Linux command “ls -l” and see if you have “ascii” in your directory.

      Please also try copying the command in yourself instead of copying from my blog or the IBM site. Some unexpected encoding might mess it up.

      Kind regards,
      -Kevin

  2. Hi Kevin,
    This was a tricky one! I misread the instructions and I misspelled the chtag instructions and I created a mess with some pieces of strange files … but reading back your steps and DONE!
    Thank you!
    Georges

  3. Hello,
    I got following error message when try to copy content of taglist:
    “EDC5003I Truncation of a record occurred during an I/O operation.”

  4. I’m having the same problem the previous commentator had, but no matter how many times I delete and redo, it still stay incomplete. However the score says the report was from a previous date. Is there a way to update the report for the scores to show completion

  5. Hi Kevin! Your blog is great. I have a problem with this challenge 9. My P2.OUTPUT(#09) member is like yours but the status still incomplete. Do you have any idea why this is happening?

    1. Hi Camilla!

      I didn’t really check the status of this solution yet. I will try and verify tomorrow morning, sorry for the delay! I have verified my solution using TSO SCOREP2 and my solution is correct.

      Maybe you could try deleting the ascii file, making it again, tagging it and then copy it again? I believe you should be able to delete the file using rm ascii when inside the OMVS environment.

      Kind regards,
      – Kevin

      1. Hi Kevin, thanks for the awesome explanations in your blog!! Very helpful!
        I’m having same issue, even though my result is the expected, my #09 challenge still showing as Incomplete 🙁
        I’ve tried to delete and redo the whole challenge but doesn’t seem to be working.
        Thank you again!

            1. Jose thank you very much!! I did the same and it updated for me as well 🙂
              Now stuck in the ch12 hehehe
              Good luck for you!

Leave a Reply

Your email address will not be published. Name, email and website not required.