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.
- ls -TH ascii
- cat ascii
- 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)!
Hello,
Do you have any plans to do the MTM2020?
Thank you,
Richard
Hello Kevin, I came across your site while working on Part 2 Challenge 9 of Master the Mainframe, as I was stuck on the changing the file tag portion of the challenge, and I just wanted to say thanks a lot for showing the proper command to make the change, as I was confused on how I was to type it all out, and now I’m on to challenge 10. Much appreciated!
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?
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
Hi Kevin!
Challenge #09 was a tricky one for me! Thanks for sharing 🙂
Regards,
Karina
Hi Karina!
Thanks for the kind words 🙂
Goodluck!
– Kevin
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
Hello,
I got following error message when try to copy content of taglist:
“EDC5003I Truncation of a record occurred during an I/O operation.”
Sorry, I just found, it can be ignored.
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
Hi Malachi
Sorry for the delay, I have had some issues myself with the scoring. It only updated it later or after a second time. Weird!
Did you solve it yet?
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?
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
It works. Thank you so much!
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!
I’m on the same boat as Camila.
I followed all the steps, and checked the p2.output the results look good but when I check my challenge it still shows incomplete. I’ve tried delete and retrying the challenge multiple times but I’m not sure why it won’t work. I attached two screenshot links for reference. Any help would be appreciated!
https://puu.sh/ExEib/5338ee50c9.png
https://puu.sh/ExEkF/cabbd4591e.png
NEVERMIND LOL
I just used tsoscorep2 to verify my solution and it updated both challenge 9 and 10 (i was also unsure if i did 10 correctly but I guess this updated it and corrected it).
https://puu.sh/ExEnv/c875db8d01.png
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!