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.
- dslist pds.data as primary command.
- e as line command next to the data set.
- s EBCDIC as primary command.
- copy ‘zos.mtm2019.public.shared.data(ebcdic)’ as primary command inside EBCDIC member.
- hex on as primary command.
- 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.
- Do not press enter key until explicitly reading ‘now press enter key’
- Tab to first empty line and type 0123456789
- Tab to second empty line and type uppercase A
- Tab to third empty line and type lowercase z
- Tab to forth empty line and type number 4096
- 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:
- Change line 2 column 1 from EBCDIC uppercase A to ASCII uppercase A
- Change line 3 column 1 from EBCDIC lowercase z to ASCII lowercase z
- 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 z 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!