From: CRDGW2::CRDGW2::MRGATE::"SMTP::CRVAX.SRI.COM::RELAY-INFO-VAX" 9-AUG-1990 22:06:14.25 To: MRGATE::"ARISIA::EVERHART" CC: Subj: re: READ/KEY=(binary)! Received: by crdgw1.ge.com (5.57/GE 1.70) id AA10891; Thu, 9 Aug 90 21:49:44 EDT Received: From CCNUCD.DENVER.COLORADO.EDU by CRVAX.SRI.COM with TCP; Thu, 9 AUG 90 15:54:02 PDT Received: by ccnucd.Denver.Colorado.EDU (cudenver.ether) Message-Id: <9008092248.AA12385@ccnucd.Denver.Colorado.EDU> Date: Thu, 9 Aug 90 16:46 MDT From: Pete Klammer 303/556-3915 Subject: re: READ/KEY=(binary)! To: Carl.J.Lydick@sol1.gps.caltech.edu, boulder!ncar!gatech!harvard!yale!LRW.COM!leichter@ccnucd, LEICHTER-JERRY@cs.yale.edu, don@gp.govt.nz, INFO-VAX@sri.com X-Vms-To: @BINARY-KEYS.DIS I'm stunned! I've been around VAX{es|en|systems} since they were internally known as the Comet project -- a long time, anyway -- and here's a punctuation mark in DCL, "&", that I never used! It works!! Thank you all, this speeds ou access to SYSUAF for accounts management. /** --poko ________________________________* "cut on dashes for mailing label" Pete Klammer (303)556-3915 FAX(303)556-4822|pklammer@cudnvr.Denver.Colorado.EDU CU-Denver Computing Services Campus Box 169|bitnet: PKLAMMER@CUDENVER 1200 Larimer St NC2506 Denver CO 80217-3364|uucp:...!boulder!pikes!pklammer **/ ================================================================ =From: CUDNVR::PKLAMMER "Pete Klammer 303/556-3915" 7-AUG-1990 15:10:11.69 = =Has anyone figured out a way to READ/KEY= a file from DCL on a non- =character key? I'm thinking of the secondary /INDEX=1 of SYSUAF (UIC's). = ================================================================= =Date: 7 Aug 1990 17:51:45 EST =From: Carl.J.Lydick%SOL1.GPS.CALTECH.EDU@ccnucd.denver.colorado.edu = =You need to use the ampersand (&KEYVAL) instead of quotes and apostrophes =("''KEYVAL'") because if there's a null byte in KEYVAL, DCL will ignore the =rest of the command. ================================================================= =Date: Wed, 8 Aug 1990 10:19:11 +0200 =From: "GWDGV1::MOELLER" = =Yes, it's possible via $ READ/KEY=&key. =First you have to create a string-valued symbol "key" (say) =containing the binary data (e.g. via $ key[...,...]=). =Note: in your case, the length of *this* string has to match =the key length exactly. =Then apply the transformation outlined in the following writeup =(posted earlier this year to INFO-VAX) - replace SBJCT by KEY in what follows: =[...] =(4) during the substitution of "&", quotation marks (") are still recognized = and must be doubled and quoted as in ordinary arguments - the remaining = 255 character codes are handled transparently. = e.g. to get a subject of ``"'' (5 bytes) by = $ mail/subject=&sbjct = you need "``""''" (8 bytes) as the contents of , viz. = $ sbjct = """" + "``" + """""" + "'"+"'" + """" =It takes quite a bit of DCL to convert an *arbitrary* string into something =that is guaranteed to work with "&", e.g. given , =$ if SBJCT.eqs."" =$ then =$ SBJCT = """""" ! quote the empty string =$ else =$ if (SBJCT-"""").nes.SBJCT =$ then ! there is at least 1 quote =$ qq_i = 0 =$ qq_result = "" =$ qq_loop: =$ qq_temp = f$element(qq_i,"""",SBJCT) =$ if qq_temp.eqs."""" then goto qq_loop_end =$ qq_result = qq_result + """" + qq_temp + """" =$ qq_i = qq_i + 1 =$ goto qq_loop =$ qq_loop_end: =$ SBJCT = qq_result =$ endif =$ endif =Hope this helps, =Wolfgang J. Moeller, GWDG, D-3400 Goettingen, F.R.Germany | Disclaimer ... =Bitnet/Earn: U0012@DGOGWDG5 Phone: +49 551 201516 | No claim intended ================================================================= =Date: Wed, 8 Aug 90 07:33:10 EDT =From: Jerry Leichter = = =Suppose THE_KEY is a symbol containing the binary key. (Such DCL features as =THE_KEY[a,b]=xxx and F$CVUI may be useful in creating and manipulating such =strings.) Then read using: = READ/KEY=&THE_KEY =This SHOULD work. I'm told that on some versions of VMS it doesn't always =work, especially when one of the bytes of THE_KEY is 0. But try it on current =versions and let me know what happens - I'm curious myself! = -- Jerry ================================================================= =Date: Thu, 9 Aug 90 17:15:45 GMT =From: Don Stokes = = =leichter@LRW.COM (Jerry Leichter, LEICHTER-JERRY@CS.YALE.EDU) writes: => Has anyone figured out a way to READ/KEY= a file from DCL on a non- => character key? I'm thinking of the secondary /INDEX=1 of SYSUAF => (UIC's). => Suppose THE_KEY is a symbol containing the binary key. (Such DCL features as => THE_KEY[a,b]=xxx and F$CVUI may be useful in creating and manipulating such => strings.) Then read using: => READ/KEY=&THE_KEY => This SHOULD work. I'm told that on some versions of VMS it doesn't always => work, especially when one of the bytes of THE_KEY is 0. But try it on curren => versions and let me know what happens - I'm curious myself! =Not sure about nuls, but if THE_KEY has a quote character in the least =significant eight bytes, the quote gets stripped. It may be that the =second character has to be a nul too. I saw this happen recently, under =VMS V5.2. =Don Stokes, ZL2TNM / / Home: don@zl2tnm.gp.govt.nz =Systems Programmer /GP/ Government Printing Office Work: don@gp.govt.nz =__________________/ /__Wellington, New Zealand_____or:_PSI%(5301)47000028::DON =================================================================