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)!

IBM MTM 2019: Part Two – Challenge #08

Hello!

This challenge is a bit the same as last year except it has a few more data types to learn. Bits, Nibbles, Bytes, Hexadecimal, EBCDIC, ASCII, and BCD. Last year we didn’t learn about Nibbles (4-bits) or BCD. Time for something new!

z/OS its default encoding is EBCDIC. EBCDIC stands for Extended Binary Coded Decimal Character Interchange Code. It’s an 8-bit-standard way to store letters and punctuation marks. Here is a handy EBCDIC table.

In each table cell above, the first row is an abbreviation for a control code or (for printable characters) the character itself; and the second row is the Unicode code (blank for controls that don’t exist in Unicode).

You can read what IBM wrote about EBCDIC on mtm2019.mybluemix.net. I won’t explain the character formats on this blog as IBM already does on the challenge page itself.

EBCDIC Character Encoding

IBM Master the Mainframe 2019 Part Two – Challenge #08

We need to edit Z#####.PDS.DATA and make a new member called EBCDIC. Then we need to copy a data set into it and change the way we view the file.

  1. dslist pds.data as primary command.
  2. as line command next to the data set.
  3. s EBCDIC as primary command.
  4. copy ‘zos.mtm2019.public.shared.data(ebcdic)’ as primary command inside EBCDIC member.
  5. hex on as primary command.
  6. cols as primary command.

This is what I see. We don’t have to do anything yet. Now let’s go back to our data set and create the next member. Press F3.

ASCII Character Encoding

Still inside PDS.DATA we create a new member ASCII and copy some data into it.

  • s ASCII as primary command.
  • copy ‘zos.mtm2019.public.shared.data(ascii)’ as primary command.
  • hex on ; reset ; as primary command.
  • source ascii as primary command.
  • cols line command at 000004.

This is what I see. Now I will enter the primary command reset to reset my view and enter the primary command cancel to cancel my changes.

BCD and Packed Decimal Character Encoding

Again in PDS.DATA we will create a new data member called packed and copy some data into it.

  • s packed as primary command.
  • copy ‘zos.mtm2019.public.shared.data(packed)’ as primary command inside edit mode of the member packed.

This is what I get. Let me first reset and then do the following.

  • Overtype line 5 with cols
  • Overtype line 6 with hx
  • Overtype line 9 with hx
  • Overtype line 12 with hx

This is the result. Looks good! Let’s cancel and select a new member so we can solve this challenge using cancel ; s #08 as primary command.

Complete the Challenge

IBM wants us to type a few things.

  1. Do not press enter key until explicitly reading ‘now press enter key’
  2. Tab to first empty line and type 0123456789
  3. Tab to second empty line and type uppercase A
  4. Tab to third empty line and type lowercase z
  5. Tab to forth empty line and type number 4096
  6. Now press enter key

Let’s enable the hex view using hex on primary command to see what we are dealing with.

Change member #08 as follows:

  1. Change line 2 column 1 from EBCDIC uppercase A to ASCII uppercase A
  2. Change line 3 column 1 from EBCDIC lowercase z to ASCII lowercase z
  3. Change line 4 columns 1-4 from EBCDIC 4096 to Packed Decimal 4096
    Line 4 – Packed Decimal 4096 will leave column 3 unused
    Line 4 – Change column 3 to x’40’, an EBCDIC space

Hmm, seems very complicated! Let’s see what I can do. I will use an array to display the changes I make. With the first element inside the array being the hexadecimal high order byte and the second element being the hexadecimal low order byte.

Change line 2 column 1 from EBCDIC uppercase A to ASCII uppercase A

We see that uppercase A in EBCDIC is [C,1]. In ASCII uppercase A is [4,1]. So let’s change that!

Change line 3 column 1 from EBCDIC lowercase z to ASCII lowercase z

Again we can consult the table above. z in EBCDIC is [A,9]. In ASCII lowercase is [7,A].

Change line 4 columns 1-4 from EBCDIC 4096 to Packed Decimal 4096

4096 EBCDIC to 4096 packed decimal is easy. [04,09,6D] will be the new number.

I have changed the other column to [4,0] so it becomes a space.

Copying to P2.OUTPUT

This is what my copy looks like.

I feel like this should be correct. Let’s overtype 000001 with line command c99 and then issue the primary command rep p2.output(#08).

I’m too curious! I’ll just run TSO SCOREP2 primary command to see if what I have is correct.

It’s correct! Phew, this was a hard one!

IBM MTM 2019: Part Two – Challenge #07

Hi there!

Today we’re going to learn a bit more about data sets. This will be a somewhat longer challenge, but hey, what has to be done has to be done. That’s a fully correct English sentence.

Data Sets

IBM Master the Mainframe Part Two – Challenge #07

Create a data set using JCL DD parameter provided by local storage administrator

Again, for starters we need to allocate a new data set using a series of commands. I will list them here for quick completion.

  • tso submit ‘zos.public.jcl(p2ch7a)’ as primary command.
  • a as jobname character.

  1. sd as primary command.
  2. prefix ; owner Z50087; st; as primary command, change my ID it to your ID.
  3. f3 to return to the ISPF Primary Option Menu.

View attributes of newly created data set

  1. dslist p2ch7.seq1 as primary command.
  2. v as line command next to the DDNAME, press enter if the VIEW ENTRY PANEL pops up.

Now we see the following data. Make a note of the LRECL, RECFM, and DSORG values. The values are needed to complete the challenge.

I took note of these values, did you?

Modify JCL to create a sequential data set using attributes you specify

Again we need a series of commands to get to the JCL we need to modify.

  • dslist JCL as primary command.
  • as line command next to the data set name.
  • s p2ch7b as primary command to create a new member inside JCL.
  •  copy ‘zos.public.jcl(p2ch7b)’ as primary command when you’re inside P2CH7B.

Inside the JCL above we need to change several things. In my case I need to change the following.

  • ###### to VPWRKA
  • LRECL=80
  • RECFM=FB
  • DSORG=PS

I have made the changes, I have also highlighted them on the screenshot above. Submit it using sub ; =sd ; st and if it asks for a jobname character choose b.

Complete the challenge by creating member #07 into your P2.OUTPUT data set

Again a series of commands.

  • tso submit ‘zos.public.jcl(p2ch7c)’ as primary command.
  • as jobname character.
  • dslist p2.output as primary command.
  • as line command next to P2.OUTPUT, press enter if the view panel comes up.
  • s as line command next to member #07 to see if the output is there.

P2CH7.SEQ1 and P2CH7.SEQ2 are present in this list. This means I have completed the challenge correctly!