Wow, Ed how do I say thank you, and yep I am a following your code.
It's great... Regards, Scott On Wednesday, March 30, 2016, Ed Jaffe <[email protected]> wrote: > On 3/30/2016 7:05 AM, Scott Ford wrote: > >> I have a need to create message table, with the following attributes: >> >> 1. MSGID = 9 chars >> 2. Length of msg >> 3. Message >> >> I would like this "tab;e" in loose terms to be external. I have never done >> external dsects. Am in right i can do that , create a external message >> table, bring it into >> storage and index into it to find messages ? If so where can I find a >> example .. >> > > For example: > > MsgEntry DSECT , > MsgId DS CL9 > MsgSize DS XL1 > MsgText DS CL80 > MsgLenth EQU *-MsgEntry > > Code LOCTR , Switch to code > ... > LOAD EPNAME==CL8'MSGTABLE' Load external message table > NILH R1,X'7FFF' Turn off AMODE indicators > NILL R1,X'FFFE' (same) > STG R1,MsgTable Save clean table address > ... > LLGH R4,MsgNum Get message number > AGHI R4,-1 Make relative to zero > MGHI R4,MsgLenth Compute offset into table > AG R4,MsgTable Point to message entry > USING MsgEntry,R4 <Synchronize MsgEntry DSECT > LAY R1,OutArea Point to output area > MVC 0(L'MsgId,R1),MsgId Copy message id > MVI L'MsgId(R1),C' ' Set blank separator > LA R15,L'MsgID+1(,R1) Point where MsgText goes > LLGC R14,MsgSize Get size of message > AGHI R14,-1 Make relative to zero > EX R14,MoveTxt Copy the message text > > Constant LOCTR , Switch to constants > MoveTxt MVC 0(*-*,R15),MsgText Dummy for execute > Code LOCTR , Switch back to code > > LA R0,1(R14,R15) Compute total msg length > SGR R0,R1 in R0 for WriteMsg service. > JAS R14,WriteMsg R1 = TextPtr, R0 = TextgLen > DROP R4 <Drop MsgEntry DSECT > ... > > -- > Edward E Jaffe > Phoenix Software International, Inc > 831 Parkview Drive North > El Segundo, CA 90245 > http://www.phoenixsoftware.com/ >
