Re: [U2] Read yourself
I think the point has been lost. The person is requesting the name of the CURRENT ROUTINE If that is A SUBROUTINE - there is no @ that I know of that returns the name of the currently executing routine. The fact the CALLING routine knows the name is #1, is of no value to this request and #2, lends nothing to any routine being "self-aware". -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Adrian Overs Sent: Monday, May 12, 2014 7:58 PM To: U2 Users List Subject: Re: [U2] Read yourself I totally agree with and endorse your programming standards David. However if the program is calling another subroutine it should know the name of that subroutine or be able to derive it if it is called with an @. Sent from my iPad On 13 May 2014, at 10:45 am, David Wasylenko wrote: IT'S JUST NOT TRUE EVER. @sentence cannot work. The stub program that launched an initial program will be in the @sentence... You could be 3 calls deep into external subroutines - there is nothing in @sentence re: the call-stack. Our shop writes *very* few stub programs - most are subroutines called by other subroutines. Instead: Add PGID="programName" Or even PGID="filename ProgramName" To the top of the program - quick and easy. Use of system routines such as SYSTEM(9001) is usually overkill. Your program should be "aware" of it's name - if no other reasons than: * display on the screen to help users identify "where" their problem came from * print on reports * add to log-file entries + and of course, to answer the original question: "how can I read the current program source" A well-designed system/program should hard-code as little as possible as well. What better key to use for a configuration record than the program name itself. -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Adrian Overs Sent: Monday, May 12, 2014 7:39 PM To: U2 Users List Subject: Re: [U2] Read yourself That's true - if the subroutines are catalogued with a noxref clause you're screwed. Sent from my iPad On 13 May 2014, at 10:19 am, David Wasylenko wrote: Wont work --- if you use any external subroutines. -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Adrian Overs Sent: Monday, May 12, 2014 7:18 PM To: U2 Users List Subject: Re: [U2] Read yourself You can get the Program name by parsing @SENTANCE You can then read the Verb from the VOC and act on that or if the item is globally catalogued then read the last line from your catdir item > From unix level use strings $catpath/$item | tail -1 and then process that. HTH Sent from my iPad On 13 May 2014, at 9:33 am, Adrian Overs wrote: What problem are you trying to solve by doing so? After all it's not rocket science (pardon the pun) to OPEN "BP" TO BP.FV THEN READ R.PROG FROM BP.FV, PROG.ID ELSE ... Whatever END Sent from my iPad On 13 May 2014, at 6:54 am, Wjhonson wrote: Does anyone have a BASIC program, that will open it's own code in a variable ? So something like this GOSUB RETURN.A.LOCAL.FILE.AND.KEY.FOR.ME READ THIS.PROGRAM FROM F.LOCALFILENAME, K.PROGRAMKEY the program reads itself. Does anyone have a program like that? ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users
Re: [U2] Read yourself
IT'S JUST NOT TRUE EVER. @sentence cannot work. The stub program that launched an initial program will be in the @sentence... You could be 3 calls deep into external subroutines - there is nothing in @sentence re: the call-stack. Our shop writes *very* few stub programs - most are subroutines called by other subroutines. Instead: Add PGID="programName" Or even PGID="filename ProgramName" To the top of the program - quick and easy. Use of system routines such as SYSTEM(9001) is usually overkill. Your program should be "aware" of it's name - if no other reasons than: * display on the screen to help users identify "where" their problem came from * print on reports * add to log-file entries + and of course, to answer the original question: "how can I read the current program source" A well-designed system/program should hard-code as little as possible as well. What better key to use for a configuration record than the program name itself. -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Adrian Overs Sent: Monday, May 12, 2014 7:39 PM To: U2 Users List Subject: Re: [U2] Read yourself That's true - if the subroutines are catalogued with a noxref clause you're screwed. Sent from my iPad On 13 May 2014, at 10:19 am, David Wasylenko wrote: Wont work --- if you use any external subroutines. -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Adrian Overs Sent: Monday, May 12, 2014 7:18 PM To: U2 Users List Subject: Re: [U2] Read yourself You can get the Program name by parsing @SENTANCE You can then read the Verb from the VOC and act on that or if the item is globally catalogued then read the last line from your catdir item > From unix level use strings $catpath/$item | tail -1 and then process that. HTH Sent from my iPad On 13 May 2014, at 9:33 am, Adrian Overs wrote: What problem are you trying to solve by doing so? After all it's not rocket science (pardon the pun) to OPEN "BP" TO BP.FV THEN READ R.PROG FROM BP.FV, PROG.ID ELSE ... Whatever END Sent from my iPad On 13 May 2014, at 6:54 am, Wjhonson wrote: Does anyone have a BASIC program, that will open it's own code in a variable ? So something like this GOSUB RETURN.A.LOCAL.FILE.AND.KEY.FOR.ME READ THIS.PROGRAM FROM F.LOCALFILENAME, K.PROGRAMKEY the program reads itself. Does anyone have a program like that? ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users
Re: [U2] Read yourself
Wont work --- if you use any external subroutines. -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Adrian Overs Sent: Monday, May 12, 2014 7:18 PM To: U2 Users List Subject: Re: [U2] Read yourself You can get the Program name by parsing @SENTANCE You can then read the Verb from the VOC and act on that or if the item is globally catalogued then read the last line from your catdir item >From unix level use strings $catpath/$item | tail -1 and then process that. HTH Sent from my iPad On 13 May 2014, at 9:33 am, Adrian Overs wrote: What problem are you trying to solve by doing so? After all it's not rocket science (pardon the pun) to OPEN "BP" TO BP.FV THEN READ R.PROG FROM BP.FV, PROG.ID ELSE ... Whatever END Sent from my iPad On 13 May 2014, at 6:54 am, Wjhonson wrote: Does anyone have a BASIC program, that will open it's own code in a variable ? So something like this GOSUB RETURN.A.LOCAL.FILE.AND.KEY.FOR.ME READ THIS.PROGRAM FROM F.LOCALFILENAME, K.PROGRAMKEY the program reads itself. Does anyone have a program like that? ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users
Re: [U2] Read yourself
OR you can use SYSTEM(9001) on universe OR you can use SYSTEM(9001) on universe OR you can use SYSTEM(9001) on universe OR you can use SYSTEM(9001) on universe OR you can use SYSTEM(9001) on universe Hmmm, thought someone said that already :-) -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Bill Haskett Sent: Monday, May 12, 2014 7:19 PM To: U2 Users List Subject: Re: [U2] Read yourself You can also use the program stack (UD - SYSTEM(49), UV - SYSTEM(9001), D3 - SYSTEM(33)). This gives not only the program running but the path. That ought to give needed information to both open the file and read the program source code. HTH, Bill - Original Message - *From:* d...@pickpro.com *To:* U2 Users List *Date:* 5/12/2014 4:55 PM *Subject:* Re: [U2] Read yourself > We always have a variable "PGID" defined at the top of the program. > This at least HELPS identify the source code. > > Most of our programs have the ability to edit the code while you are in the > program via some common "hot-keys" > built into our core system. (controlled by security) There is also a > hot-key to view source in a custom program, outside the editor. > > We use 'PGID' to identify the name of the current program. > > In universe, you may also look at the results of SYSTEM(9001) to get the > current execution stack. > If your object file is type-19, and long-names are ON - it's easy to parse. > > -Original Message- > From: u2-users-boun...@listserver.u2ug.org > [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Wjhonson > Sent: Monday, May 12, 2014 6:48 PM > To: u2-users@listserver.u2ug.org > Subject: Re: [U2] Read yourself > > > I understand how one could potentially do it. > I was more interested to see if anyone had already done it. > Cat pointers only work for catalogued entries by the way > > > > -Original Message- > From: Israel, John R. > To: U2 Users List > Sent: Mon, May 12, 2014 4:41 pm > Subject: Re: [U2] Read yourself > > > There are @ commands that can get this stuff. Or read the cat pointer. > > John Israel > > Sent from my iPhone > >> On May 12, 2014, at 7:39 PM, "Wjhonson" wrote: >> >> >> The program does not inherently know that it's in a file called "BP". >> And it does not know it's own (value of) PROG.ID unless it can find >> it out > somehow. >> >> >> -Original Message- >> From: Adrian Overs >> To: U2 Users List >> Sent: Mon, May 12, 2014 4:33 pm >> Subject: Re: [U2] Read yourself >> >> >> What problem are you trying to solve by doing so? >> After all it's not rocket science (pardon the pun) to OPEN "BP" TO >> BP.FV THEN READ R.PROG FROM BP.FV, PROG.ID ELSE ... Whatever END >> >> Sent from my iPad >> >> On 13 May 2014, at 6:54 am, Wjhonson wrote: >> >> >> Does anyone have a BASIC program, that will open it's own code in a variable >> ? >> So something like this >> >> GOSUB RETURN.A.LOCAL.FILE.AND.KEY.FOR.ME >> >> READ THIS.PROGRAM FROM F.LOCALFILENAME, K.PROGRAMKEY >> >> the program reads itself. >> >> Does anyone have a program like that? >> >> >> ___ >> U2-Users mailing list >> U2-Users@listserver.u2ug.org >> http://cp.mcafee.com/d/5fHCMUSyOqejhOqemhNEV7e6XCQrEFLThKCqejqdQkTXEF >> E >> CzASzt5d-WdSrCQrEFCzBZBxwQsCN6Fe4GhTPMkxFqtokrm-cGNVsSxFqtokrm-cGNVsS >> e >> 847QhPb_nV5BZZAQsZuVtd5ZPATTD67KmKDp55mVEVvVkffGhBrwqrhdICXCXCM0pYGjF >> Y >> jfNVJdIzM071dnoovaAVgtHzqptKDNErrjbJQ-d2V2Hsbvg57OFeDNc_7CQSOf00jr3P3 >> x I5-Aq83iS4QPiWq80n-E6y0JlKdfftdFFCW--6tgnb718Y >> ___ >> U2-Users mailing list >> U2-Users@listserver.u2ug.org >> http://cp.mcafee.com/d/k-Kr6jqb9EVd79EVp76zAsUrKrhKyC_t6WpEVdEThjvKyC >> y >> qejqdQkTXETpKrhKyCqenSm63hOr4qAUiF7vf1i6BFRxhJrUOH7BPq6BFRxhJrUOH7BPo >> U >> wgvh7cLZvAmnTSjhPRXBQQnTejvusouVqWtAklrCzB_BgY-F6lK1FJcSOrKrKr01DOFeD >> N >> c_7CQSOf00s4RtxxYGjB1SKdFBSWv6xJJcKTjUQbAaJMJZ0kvaAWv4PYurjr8Y01dIfce >> 6 MnWhEwdbojjdbFEw1vWwq82RmUQYZQSCCrHzJY >> >> >> ___ >> U2-Users mailing list >> U2-Users@listserver.u2ug.org >> http://cp.mcafee.com/d/2DRPoQ93hJ5AQsCzAQsIzzhOesdTdEThjvKztcQsCQrEFL >> T >> hjhd79J6WarZQrITdEThjd7bXb31EVdydis9kzLDwF3iQWMESJYplzOVJ3iQWMESJYplz >> O >> VIsg8fEzCn-LObbXX9EVWZOWqbXD9LLecfsJteOaaJPhO_OEuvkzaT0QSOrpdTdTdw0PV >> k >> DjUCvzPqrp7w0e2qKMM-l9OwXn6QOXtfzgSSCnrFYq5O5mUm-wafBitfyp-fdFJAu00CS >> 7 C73obZ8Qg6BI9FCBQQg0LZgd41qHsquuWrjjdPC62kJ0KQBUS > ___ > U2-Users mailing list > U2-Users@listserver.u2ug.org > http://listserver.u2ug.org/mailman/listinfo/u2-users > > > ___ > U2-Users mailing list > U2-Users@listserver.u2ug.org > http://listserver.u2ug.org/mailman/lis
Re: [U2] Read yourself
We always have a variable "PGID" defined at the top of the program. This at least HELPS identify the source code. Most of our programs have the ability to edit the code while you are in the program via some common "hot-keys" built into our core system. (controlled by security) There is also a hot-key to view source in a custom program, outside the editor. We use 'PGID' to identify the name of the current program. In universe, you may also look at the results of SYSTEM(9001) to get the current execution stack. If your object file is type-19, and long-names are ON - it's easy to parse. -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Wjhonson Sent: Monday, May 12, 2014 6:48 PM To: u2-users@listserver.u2ug.org Subject: Re: [U2] Read yourself I understand how one could potentially do it. I was more interested to see if anyone had already done it. Cat pointers only work for catalogued entries by the way -Original Message- From: Israel, John R. To: U2 Users List Sent: Mon, May 12, 2014 4:41 pm Subject: Re: [U2] Read yourself There are @ commands that can get this stuff. Or read the cat pointer. John Israel Sent from my iPhone > On May 12, 2014, at 7:39 PM, "Wjhonson" wrote: > > > The program does not inherently know that it's in a file called "BP". > And it does not know it's own (value of) PROG.ID unless it can find it > out somehow. > > > > > -Original Message- > From: Adrian Overs > To: U2 Users List > Sent: Mon, May 12, 2014 4:33 pm > Subject: Re: [U2] Read yourself > > > What problem are you trying to solve by doing so? > After all it's not rocket science (pardon the pun) to OPEN "BP" TO > BP.FV THEN READ R.PROG FROM BP.FV, PROG.ID ELSE ... Whatever END > > Sent from my iPad > > On 13 May 2014, at 6:54 am, Wjhonson wrote: > > > Does anyone have a BASIC program, that will open it's own code in a variable ? > So something like this > > GOSUB RETURN.A.LOCAL.FILE.AND.KEY.FOR.ME > > READ THIS.PROGRAM FROM F.LOCALFILENAME, K.PROGRAMKEY > > the program reads itself. > > Does anyone have a program like that? > > > ___ > U2-Users mailing list > U2-Users@listserver.u2ug.org > http://cp.mcafee.com/d/5fHCMUSyOqejhOqemhNEV7e6XCQrEFLThKCqejqdQkTXEFE > CzASzt5d-WdSrCQrEFCzBZBxwQsCN6Fe4GhTPMkxFqtokrm-cGNVsSxFqtokrm-cGNVsSe > 847QhPb_nV5BZZAQsZuVtd5ZPATTD67KmKDp55mVEVvVkffGhBrwqrhdICXCXCM0pYGjFY > jfNVJdIzM071dnoovaAVgtHzqptKDNErrjbJQ-d2V2Hsbvg57OFeDNc_7CQSOf00jr3P3x > I5-Aq83iS4QPiWq80n-E6y0JlKdfftdFFCW--6tgnb718Y > ___ > U2-Users mailing list > U2-Users@listserver.u2ug.org > http://cp.mcafee.com/d/k-Kr6jqb9EVd79EVp76zAsUrKrhKyC_t6WpEVdEThjvKyCy > qejqdQkTXETpKrhKyCqenSm63hOr4qAUiF7vf1i6BFRxhJrUOH7BPq6BFRxhJrUOH7BPoU > wgvh7cLZvAmnTSjhPRXBQQnTejvusouVqWtAklrCzB_BgY-F6lK1FJcSOrKrKr01DOFeDN > c_7CQSOf00s4RtxxYGjB1SKdFBSWv6xJJcKTjUQbAaJMJZ0kvaAWv4PYurjr8Y01dIfce6 > MnWhEwdbojjdbFEw1vWwq82RmUQYZQSCCrHzJY > > > ___ > U2-Users mailing list > U2-Users@listserver.u2ug.org > http://cp.mcafee.com/d/2DRPoQ93hJ5AQsCzAQsIzzhOesdTdEThjvKztcQsCQrEFLT > hjhd79J6WarZQrITdEThjd7bXb31EVdydis9kzLDwF3iQWMESJYplzOVJ3iQWMESJYplzO > VIsg8fEzCn-LObbXX9EVWZOWqbXD9LLecfsJteOaaJPhO_OEuvkzaT0QSOrpdTdTdw0PVk > DjUCvzPqrp7w0e2qKMM-l9OwXn6QOXtfzgSSCnrFYq5O5mUm-wafBitfyp-fdFJAu00CS7 > C73obZ8Qg6BI9FCBQQg0LZgd41qHsquuWrjjdPC62kJ0KQBUS ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users