Author: Jeff Bangert( question@kuhub, question@oread, question@ukanaix, question@stat1 ) Introduction --------------------------------------------------- This writeup contains a selection from the questions that have been asked on QUESTION. Both new and experienced users should look at each question and answer. Even if you've been using the VAX for years, you may find an answer to a question you should have asked. Although most of these questions came from the VAX 9000, OREAD users will find many of the answers helpful. Look in the file DUA1:[QUESTION]VAXFAQ.TXT for the latest version of this writeup. You can TYPE/PAGE DUA1:[QUESTION]VAXFAQ.TXT or COPY DUA1:[QUESTION]VAXFAQ.TXT * to get your own copy. OREAD users can run the same commands. General Questions ---------------------------------------------- Question: I just got a VAX account, what do I do now? Answer: First, get the basic writeups: "VAX Intro", "MAIL", "EMACS", and "NEWS." Look through them to get a quick idea of what they contain. Then sit down at a PC or Mac, sign on to the VAX, and practice. If you are nervous about the whole thing, do this at the Computer Center when Consulting is open. Then if things don't seem to be working for you, ask the consultant for help. Question: I need to talk to someone. Answer: Come to the Computer Center any time between 10 and 12 or 1 and 4 on a weekday. In the southwest corner of the big user area is the Consulting window. The consultants will do their best to help you -- no charge. However, just to keep you on your toes -- during summer school, we only have consulting in the afternoon. Between terms, we don't have regular consulting hours, but you can always talk to a consultant on the phone outside the consulting window. Question: I need to talk to someone, but I can't get to the Computer Center right now. Answer: Call (913) 864-0410 between 8 and 5 weekdays. We will try to help you. Question: I'm running on the VAX and I have a question. Answer: Send MAIL to the account QUESTION. This also works on OREAD, stat1, ukanaix and UKANVM. We will try to email the answer to you within 24 hours on working days, sometimes even on a weekend. Hard questions may take longer. Question: I'm having trouble using the HELP command. What am I doing wrong? Answer: Nothing. The HELP command on the VAX is not as helpful to new users as we would like. After you have some experience, you can often use the HELP command to answer a question without looking through a manual. If you are just starting to use the VAX, try HELP HINTS, but the best thing is to send MAIL to QUESTION or ask a consultant. Question: I'd like to look up something in a manual. Answer: Come to the Computer Center Customer Assistance window. Any VAX manual can be checked out for use in the building. Also, many libararies on campus have selected VAX manuals on reserve. To find out where the manuals are, type HELP MANUALS Question: How can I put the HELP information on a file? Answer: Suppose you want to know about the DIR command. To see the information on your screen, type HELP DIR To put the same material on a file named HELPDIR.TXT, HELP /OUTPUT=HELPDIR.TXT DIR At this point you can use EMACS to look through HELPDIR.TXT. To learn about the /SIZE qualifier for DIR, you would type HELP /OUTPUT=HELPDIR.TXT DIR /SIZE If you want everything there is to know about DIR, HELP /OUTPUT=HELPFILE.TXT DIR... Question: I'm not sure what the word 'userid' means. Answer: It's the name you use when you sign on to the VAX. If you are not sure what this means and you are already signed on to the VAX, type this: SHOW PROCESS Your userid will follow "User:". Question: I've got a weird error message. Is there an easy way to show you exactly what it is? Answer: Yes, and I'm glad you asked. Many times I get questions which I could answer if I knew exactly what the error message was or what was on the screen. Here's how it's done. Use PHOTO to capture your output or error message, then use SEND to send it to me. PHOTO PHOTO /EXIT SEND /FILE PHOTO.LOG QUESTION After you run PHOTO /EXIT, there will be a file called PHOTO.LOG which is a complete record of your session. Do not hesitate to look at it yourself. You may be able to solve your own problem. You can also include some useful information on the PHOTO.LOG, for example PHOTO TYPE LOGIN.COM SHOW QUOTA DIR /SIZ [...]*.* PHOTO /EXIT SEND /FILE PHOTO.LOG QUESTION Suggestion: right after SEND, send me some MAIL to explain what the problem is. I may be dealing with 10 different problems at once, and I might not be real clear about yours. Thanks. Disk Problems -------------------------------------------------- Question: I think I'm running out of disk space. How can I check? Answer: There are several ways to find out how much file space you are using. The primary one is SHOW QUOTA On the VAX, 1 block = 512 bytes = 1/2 K We have created a special system to provide temporary disk space. This will be indicated by something like permitted overdraft of 8000 blocks from SHOW QUOTA. This means that you can use up more than your authorized limit. But, when you go over your limit, you must remove the extra files by midnight. If you don't, you will not be able to create new files the next day. To see the size of each file, enter DIR/SIZ=ALL this will show you each file in the current directory. The listing will have lines that look like this: PROJ1.PAS 2/10 This means that the file PROJ1.PAS has been allocated 10 blocks, but is only using 2 of them. If some files have many more bytes used than allocated, you can gain a little more space, by entering SET FILE /TRUNC PROJ1.PAS To see the size of all your files, start in your root directory and enter DIR/SIZ=ALL [...]*.* People often want to be creative with the above line. Type it in exactly as given, starting from your root directory. Question: How do I get rid of files? Answer: If there is a file you no longer need, you can get rid of it with DEL PROJ1.PAS; Note the ';' at the end. This is required. It means that the latest version of the file will be deleted. DEL PROJ1.PAS;* will delete all versions of the file. Please *BE CAREFUL* when deleting files. There are some you MUST NEVER DELETE: NEWSRC. SYSBULL.DAT *.MAI userid. where "userid." means the file whose name is your userid. Question: What are these .MAI files? How do I get rid of them? Answer: NEVER DO ANYTHING TO A .MAI FILE. These are your MAIL database. Messages you have received are stored in them. Never try to delete, edit or do anything else to a .MAI file. If you do, you may not be able to read your mail. If you think that .MAI files are taking up too much space, then you need to 1) run MAIL and delete messages, 2) use EXTRACT in MAIL to copy a message to a file, then download the file to your PC or Mac, 3) use the COMPRESS command in MAIL. Question: I don't like to look at all those .MAI file. Can I move them somewhere else? Answer: run MAIL and enter SET MAIL_DIRECTORY [.MAIL] This will create a subdirectory [userid.MAIL] and move all the .MAI files there. You don't have to do anything else; it all happens automatically. Question: How do I delete a subdirectory? Answer: it's a little tricky. Suppose your userid is CHERYL with subdirectory SUBDIR. What you have to do is 1. delete all files from SUBDIR. 2. change the protection on SUBDIR.DIR. 3. delete SUBDIR.DIR. Here are the commands: SET DEF [CHERYL] DEL [CHERYL.SUBDIR]*.*;* SET PROT=O:D SUBDIR.DIR DEL SUBDIR.DIR;* If SUBDIR has subdirectories, do the same thing to them. Question: What does ';1' mean at the end of a file? How can I change it? Answer: ';1' at the end of a file name means this is the first version of the file. If you edit the file, the result will be version 2. You'll see ';2' at the end of the file name. In almost all cases DO NOT USE THE VERSION LIMIT WHEN YOU TYPE A FILE NAME To edit proj1.pas, enter EMACS PROJ1.PAS do not enter EMACS PROJ1.PAS;5. In fact, there is a bug in EMACS related to the version number. If you use it, EMACS will not save your file. If you need to work with an older version of the file, do RENAME PROJ1.PAS;4 PROJ1.BAK EMACS PROJ1.BAK There is a sytem parameter called the 'version limit.' It is the maximum number of versions you can have for a file. The version limit is set to 2 to save file space. Thus, when you change a file, you have a backup version. If you want to change the version limit to 5 on all current files, do: SET FILE /VERSION_LIMIT=5 [...]*.*;* To change the version limit to 5 an all subsequently created files: SET DIR/VERSION_LIMIT=5 [...] To allow unlimited versions, use /VERS=0 in both of the above. File Protection ------------------------------------------------- Question: How can I let everyone read one of my files? Answer: The answer to this question is a little more complicated than you may like, but the whole idea here is *protection*, which means that the VAX is trying hard to be sure that no one accesses a file which does not belong to them. First suppose that you don't have any subdirectories. You have to set the protection on your login directory, then on the file. For example, if your userid is SMITH and the file is MYFILE.TXT, then the whole file name is [SMITH]MYFILE.TXT. To let everyone read this file, enter SET DEF [SMITH] SET PROT=W:E [-]SMITH.DIR What this does is give World Execute permission to your root directory. This is needed for other users to access any file. Then you can set the protection on the file SET PROT=W:RE MYFILE.TXT If you have subdirectories, give World Execute permission to each one above the file. This will look something like this: SET PROT=W:E [SMITH]SUBDIR.DIR For more information, enter HELP SET PROT Question: How can I allow just one person to read one of my files? Answer: this is going to be a long answer. First, it's much easier to let the whole world read the file. Use ordinary file permissions if you can. If you really want just one person to be able to access a file, you will be working with the file's Access Control List(ACL) which is information attached to the file. Each ACL contains one or more Access Control Entries(ACE). Each ACE allows one user to access the file. Here are the basic operations. Assume you have a file named DUA1:[JONES.PASCAL]PROJ1.PAS Note that JONES is your userid and the file is located in the subdirectory [JONES.PASCAL]. You want the userid BROWN to be able to read the file. In all the command lines below, you only need to type the uppercase characters. The following will be much clearer if you understand directories on the VAX, if you don't, see the "Intro. to VAX/VMS" writeup. 1. What is the current ACL on the file? To answer this question, enter SHow ACL [JONES.PASCAL]PROJ1.PAS If your default directory is [JONES.PASCAL] then SHow ACL PROJ1.PAS 2. How do I give BROWN permission to read the file? SET ACL/ACl=(Identifier=BROWN,Access=Read) PROJ1.PAS SET ACL/ACl=(Identifier=BROWN,Access=Read) [JONES]PASCAL.DIR SET DEFault [JONES] SET ACL/ACl=(Identfier=BROWN,Access=Read) [-]JONES.DIR The thing is -- you not only have to set the ACL on the file, you have to do it to EACH DIRECTORY ABOVE THE FILE. This means the directory to which the file belongs and the directory [-]JONES.DIR which defines your userid. Note that [-]JONES.DIR is an abbrevation for [000000]JONES.DIR. The short form [-]JONES.DIR is only valid if your default directory is [JONES]. 3. How do I remove the ACL completely? SET ACL/DELete PROJ1.PAS For more information about each command, use HELP. For example, HELP SET ACL However, there seems to be no on-line description of an ACE and the manuals are confusing, since, in the sections which explain ACLs, they also describe other VAX capabilites in which most users are not interested. MAIL ----------------------------------------------------------- Question: I was typing in MAIL and got a funny error message. What is wrong? Answer: on the VAX, don't type a long line. Before the cursor gets to the right edge of the screen, hit . If you don't, you will get something like this: MAIL-E-READERR, error reading SYS$INPUT -RMS-W-RTB, 256 byte record too large for user's buffer This says that you can't enter more than 255 characters on a line. Question: MAIL says I have one message unread, but I can't seem to read it. What do I do? Answer: this isn't your fault. It's a well-known bug. To fix it, read all your 'real' mail. Then enter READ/NEW Question: My primary .MAI file is 30 blocks long. This is a lot of space. How can I reduce it? Answer: Sorry, you can't. 30 blocks is the minimum size for that file. Question: How do I get rid of messages people have sent me? Answer: First, read the "MAIL" writeup. It's available in Consulting ( open 10 - 12, 1 - 4, M - F ). Your messages are stored in 'folders'. When you get a message, it's in the NEWMAIL folder. When you read it, it goes to the MAIL folder, if you don't delete it. To delete a message while you are reading it, just type 'D'. To get rid of messages in the MAIL folder: SELECT MAIL -- select the MAIL filder. DIRECTORY -- to see what's there. 5 -- to read message #5. DELETE -- to delete the message you are reading. DELETE 5 -- to delete message #5. Question: I can't remember what folders I've created. How do I get a listing of them? Answer: in MAIL: DIRECTORY/FOLDER Question: The .MAI files clutter up my root directory. Can I put them somewhere else? Answer: Yes. In MAIL, type SET MAIL_DIRECTORY [.MAIL] This will create a subdirectory for all subsequent MAIL files and copy your current MAIL files to the MAIL directory. Question: How do I print one of my messages? Answer: The trick is to copy a message to a file with EXTRACT. In MAIL, when you are reading a message, type: EXTRACT file_name This copies the current message to the file named 'file_name.txt'. If you don't include your own extension, the default extension is '.txt'. Then you can print the file as you would any other file. Question: I'd like to send a file to one of the other computers on campus. How do I do it? Answer: It depends on the computer and the file. I'll assume you want to send an ASCII file. 'ASCII' means text: letters and numbers. The other kind of file is called 'binary.' Executable programs or compressed files are binary. If you can read the file in EMACS, it's ASCII. The easiest way to send an ASCII file to another computer is to use MAIL. Run MAIL and type SEND filename It will respond To: and you will enter the address to send the file to. For each computer, you must have a userid to send to. Then the address will be: Computer Address Comp. Center Amdahl in%"userid@ukanvm.bitnet" Comp. Center VAX 9000 userid CS DEC 5000 in%"userid@hawk.cs.ukans.edu" ECE VAX ece::userid Physics VAX kuphsx::userid TISL VAX turing::userid To get more information about MAIL, ask for the VAX MAIL writeup in consulting, or do HELP MAIL, or do HELP inside MAIL. If the person at the other end is running MAIL under VMS, EXTRACT filename will place a copy of the file you sent onto their file. This copy will include some extraneous information called the 'header.' To make the copy without the header type EXTRACT/NOHEADER filename Question: I'm running on the ECE VAX. How do I send a file to kuhub? Answer: use MAIL, as in the answer to the last question. Then the address will be Computer Address Comp. Center VAX 9000 KUHUB::userid Question: Can I send a file through BITNET from the VAX, without having an account on the IBM? Answer: Yes. Use MAIL, but now you will need to know both a userid and a 'nodeid', the name of a BITNET node. Computer Address BITNET node in%"userid@nodeid.bitnet" Programming ---------------------------------------------------- Question: What's the easiest way to compile and run and program? Answer: If you have a file PROG.FOR, or PROG.PAS, or PROG.C enter EXEC PROG Do HELP EXEC for more information. Question: How do I get my program to read parameters from the command line? Answer: Find out which disk your account is on: SHOW DEFAULT I get HSC00$DUA1:[QUESTION] It's the DUA1 that you are looking for. Now you can install your program as a foreign command: MYPROG == "$DUA1:[QUESTION]MYPROG.EXE" Note the '$'. This is required. You will substitute your own disk and userid for 'DUA1:[QUESTION]'. Test this by typing MYPROG some arguments If you are going to use the same program name repeatedly, you can put this into your LOGIN.COM: $ MYPROG == "$DUA1:[QUESTION]MYPROG.EXE" Question: I got an access violation message when I ran my program. What does it mean? What do I do about it? Answer: You have my sympathy. There is a kind of error that can have several symptoms. Access violation is one of them. If you are writing in FORTRAN or C, the cause will be 1) a subroutine argument list doesn't match the definition, or 2) storing a value in an array outside its limits. In C you may have 3) a bad pointer reference. What happens is that some part of your program's memory gets clobbered. The big problem is that you don't know exactly where the error ocurred, since a program can overwrite memory but keep on running. What you need to do is start at the last statement executed and look backwards for one of the three kinds of errors listed above. You can also add some output statments, but BEWARE. When you add PRINT or printf statements the error message may go away! This doesn't mean the program is fixed. It means that a different part of memory is being clobbered. You still have to fix your program. If you've looked at your program for a half hour and not found anything, bring a listing into Consulting. It may help to have another person look at the code. Question: How do you get random numbers in C: Answer: In most situations, what you want are *uniform* random numbers. This means floats in the interval (0,1). ANSI C has a function rand() that produces integers in the interval (0,RAND_MAX). To get uniforms, divide rand() by RAND_MAX. Here is a program that works on the VAX -- and on UNIX. /* tr.c - test random generator. */ #include float uniform( ); main() { int i, seed; printf( "trand.c starts running.\n" ); /* seed should be a 9 digit, odd number that's hard */ /* to remember */ seed = 875691973; srand( seed ); printf( " integer float\n" ); for( i = 0; i < 8; i++ ) { printf( "%11d\t%4.2f\n", rand(), uniform() ); } printf( "trand.c stops. No problems.\n" ); } float uniform( ) { return (float)rand() / (float)RAND_MAX; } DCL ------------------------------------------------------------- This section answers questions about DCL, Digital Command Language, programming. Question: Can I run my COM files without typing '@'? Answer: there are two ways: 1. Define a symbol. For example, I have a COM file which compiles and runs a FORTRAN program. It's name is FR.COM. In my LOGIN.COM is the line. $ FR == "@[QUESTION]FR" Then I only have to type FR To compile and run the program. 2. define your own command. This is much more complicated. If you are interested, look at SET COMMAND and read about 'command definition' in Vol. 4A of the VAX manuals. Networking ------------------------------------------------------ This section answers some questions about networking, the internet, and BITNET. Question: What do I do so that other people can finger me? Answer: In your root directory, create a file called 'PLAN.TXT'. Then give it world read permissions. If your userid is CHERYL, do SET DEF [CHERYL] SET PROT=W:E [-]CHERYL.DIR SET PROT=W:RE PLAN.TXT The file PLAN.TXT should contain information about you. Question: Is it possible to have an electronic 'phone conversation' with another user? Answer: Yes. You can use PHONE, TALK, or SEND, but each of these commands operates a little differently. I'll provide enough information to get you started. Here are the basic commands: PHONE VAX_userid TALK internet_address SEND BITNET_address "message" To respond to a PHONE request, you can PHON A -- answer PHON E -- reject the request When you are in PHONE, just type. Ctrl-Z -- hangup, exit PHONE To learn more, do HELP PHONE and read the VMS PHONE Utility Manual. To respond to a TALK request TALK userid -- answer TALK userid Ctrl-C -- reject the request In TALK Ctrl-C -- hangup and exit To learn more, do HELP TALK SEND is a BITNET command, which will send one line or a whole file to a BITNET address. To learn more, do HELP SEND If you do not want to receive any PHONE or TALK requests, do SET BROAD=NOPHONE If you do not want SEND messages from other VAX users, do SET BROAD=NOUSER1 Note: when I am signed on to QUESTION, I am usually replying to a user question, so I tend ignore PHONE, TALK and SEND. Don't PHONE or TALK or SEND to QUESTION. Use MAIL. Question: I have a file ROBOT.TAR$5N$Z;1 ( or robot.tar.Z ) what do I do with it? Answer: There are programs on the VAX to deal with this file, but they are not well documented. Here are some things you should know. What you have, robot.tar.Z, is a standard compressed 'tar' file, which was probably created on a UNIX system. The '.Z' indicates Lempel-Ziv-Welch compression. The '.tar' means that when the file is untarred, it may create many new files and may create new DIRECTORIES. So, you need to be careful -- 1. The result of uncompressing may take lots of disk space. 2. The result of untarring may create a huge directory structure. Also, you will have noted that file names on the VAX cannot have two periods in them, so the name robot.tar.Z was changed into ROBOT.TAR$5N$Z. Ideally, if you have an account on a UNIX system, and enough file space, you should ftp ( binary ) the file to UNIX, then be sure that it's name is robot.tar.Z and do uncompress robot.tar.Z tar -xvf robot.tar On many systems, this takes very little time. If you don't have a UNIX system handy, then you will be using either the VAX or a PC. To use the VAX you will be temporarily turning it into a UNIX system which goes under the name 'POSIX.' Here are the commands: posix tar -xvfz robot.tar$5n$z exit This will produce files and directories in your current directory. If what you have is a .Z file, do not use POSIX. Stay in VMS and do @SYS$PUBLIC:LZW LZDCMP /EXPORT=NOEND MYFILE.Z MYFILE where 'MYFILE.Z' is the name of your .Z file and 'MYFILE' is the name of the uncompressed file that will be created.