To give you fair warning, today's example from rpresser is old. Reeaaaallllyy old. We're talking from the-age-of-dinosaurs old. No, seriously; computer-animated dinosaurs debuted in Jurrasic Park that year (1993). Anyway, the author of this code figured out a rather unique way to querying data from a RS/6000: stack the keyboard buffer (like SendKeys) with commands to use the interactive file transfer tool "ASTFT11", export the data file to the PC disk, read it from disk, and then finally query it:

if parm = "236"
   !STACKEY W180 "ASTFT11" CR "LOU" CR "PC" CR F2 "IVR236.TXT" CR "1" CR "IVR236" CR 
   quit
elseif parm = "PO"
   !STACKEY W180 "ASTFT11" CR "LOU" CR "PC" CR F2 "IVRPO.TXT" CR "1" CR "IVRPO" CR 
   !STACKEY W255 W255 W255 W255 W255 W255 W255 W255 W255 ES ES ES "IVR236 AAA" CR
   quit
elseif parm = "AAA"
   !STACKEY W180 "ASTFT11" CR "LOU" CR "PC" CR F2 "IVRAAA.TXT" CR "1" CR "IVRAAA" CR 
   !STACKEY W255 W255 W255 W255 W255 W255 W255 W255 W255 W255 W255 W255 W255 W255 W255 W255 
   !STACKEY W255 W255 W255 W255 ES ES ES "IVR236 236" CR
   quit
endif

Update, to clarify things, from the comments ...

So to translate for modern programmers, they are doing the equivalent of the following:

  1. Programatically open a command prompt.
  2. Programatically send keys to the command prompt to tell the database (like sql server, oracle, etc.) to export one of its tables to an ASCII/Text file.
  3. Programatically load the text file into memory and read it line by line until you get all the data you want.

Imagine doing this today using a modern programming language and database (Java/Oracle, C#/Sql Server, etc.) 

Yes...comprehension...now the pain sets in.

[Advertisement] BuildMaster allows you to create a self-service release management platform that allows different teams to manage their applications. Explore how!