Now we can make some modifications to the Hello World program from before and use extended attributes. In the original, Version One, of Hello World we used the following data stream:
x'C3114BF0',x'1DF8',C'HELLO, WORLD!'
Now we will modify it to make the words appear in Reverse Video and in Yellow using the following 3270 data stream:
x'C3114BF0',x'2903',X'C0F0',X'41F2',X'42F6',C'HELLO, WORLD!',X'1DF0'
You will notice we swapped out the original SF (1DF8) with our SFE stream. We also added a field definition at the end of our message to start a new field. By starting a new field we terminate the first field and reset the default attributes for the new field.
We will now modify our TSO program to write out our updated message.
HELLO1 CSECT , SAVE (14,12),,* LR 12,15 USING HELLO1,12 * LA 1,SAVEA ST 1,8(,13) ST 13,4(,1) LR 13,1 * STFSMODE ON,INITIAL=YES STTMPMD ON * TPUT STREAM,STREAMLN,FULLSCR * TGET INBUF,INBUFLN,ASIS * STLINENO LINE=1 STFSMODE OFF STTMPMD OFF * L 13,4(,13) LM 14,12,12(13) SLR 15,15 BR 14 * STREAM DS 0C DC X'27' ESCAPE CHAR DC X'F5' ERASE/WRITE DC X'C3' WCC DC X'114BF0' SBA DC X'2903' SFE (Three Attribute Pairs To Follow) DC X'C0F0' ATTR #1 (BASIC = PROTECTED) DC X'41F2' ATTR #2 (HIGHLIGHTING = REVERSE) DC X'42F6' ATTR #3 (COLOR = YELLOW) DC C'HELLO, WORLD!' DC X'1DF0' SF (PROTECTED / END PREV FIELD) STREAMLN EQU *-STREAM * INBUF DS XL128 INBUFLN EQU *-INBUF * SAVEA DS 18F END , |
I suggest you try entering this small program, compiling, link editing it and then run it under TSO using the CALL command.
There are problems running this program under MVS 3.8J on Hercules. Please see the next section for information on using the Set Attribute order to achieve the same results on MVS 3.8