** c:\djh\cc\slc\README.LNZ *** L=002 --- 2007/08/15 21:46:06 (L07) SELCOPY/LNZ Install Guide for S/390 GNU/Linux 3.2 and above. Copyright: Compute(Bridgend)Ltd UK Tel: +44 (1656) 652222 Fax: +44 (1656) 652227 Eml: support@cbl.com * Contents * ** Overview. Files on Distribution Master (DMS_LNZ.ZIP) SELCOPY/LNZ Install SELCOPY/LNZ Test Drive 1. Ctl stmts at the console when selcopy asks for them. 2. Ctl stmts from the command line. 3. Ctl stmts from a file. 4. Ctl stmts from an existing file, but pass some args. 5. Ctl stmts as used for SELCOPY on the IBM M/f. * Overview * ** Essentially, SELCOPY for the AS/400, the PC, Windows NT and the various flavours of unix, are the same program, written in C++ to emulate the IBM mainframe version of SELCOPY, simply recompiled on each platform. All documentation for SELCOPY applies equally to all platforms unless stated otherwise. * Files on the SELCOPY/LNZ Distribution Master * (DMS_LNZ.ZIP) *** readme.lnz Info on SELCOPY/LNZ for Linux. (This file.) snnn_bbb The SELCOPY main executable. e.g. s208_905 Where nnn indicates the release number. e.g. 208 for Rel 2.08 and bbb indicates the build level. e.g. 905 You will create a symbolic link to s208_905 later called selcopy. snfnnn.txt Selcopy New Features for Rel n.nn (Release Notes) showing changes and corrections implemented. Please read this file and at least check any "Important Changes". slccall.c Sample C source code which you can modify to add your own CALL rtns, which can then be compiled and linked, to create the "libselc.so" shared object library. The shared library, libselc.so, does not need to exist unless the CALL stmt is used. See "slccall.c" for info on how to add your own CALL routines, using the libselc.so dynamic shared library. slccall.h C Header file for the slccall.c source. selcopy.nmx Original skeleton for "selcopy.nam" file. Copy this to create the "selcopy.nam" file which you then tailor for your installation. The "selcopy.nam" file is essential for execution of selcopy. It contains the software keys to enable the product. selcopy.msg Editable text file of SELCOPY Error messages used at run time. It is release independent. The "selcopy.msg" file is not essential, but if not found on the path, error messages are reported only by number, without any text. * SELCOPY/LNZ Install * *** ############# Minimum Op Sys reqd: GNU/Linux 3.2 ############# For convenience, set an environment variable. # setenv s s208_905 Position your current directory as reqd. # cd /Your/base/dir Make a directory called s208_905. # mkdir -m 777 $s Make s208_905 your current directory. # cd $s Unzip/Copy files from the Distribution Master to the release-specific directory, "s208_905". Set required permissions on all files. # chmod 644 * Set executable permission for the selcopy program. # chmod 755 $s Create Local Configuration file, "selcopy.nam", a release independent config file for selcopy at your site. # cp -p selcopy.nmx selcopy.nam Create 3 symbolic links in a directory mentioned in the path environment variable for selcopy users, e.g. $home/bin # cd $home/bin # ln -s -f /Your/base/dir/s208_905/s208_905 selcopy # ln -s -f /Your/base/dir/s208_905/selcopy.nam selcopy.nam # ln -s -f /Your/base/dir/s208_905/selcopy.msg selcopy.msg Edit "selcopy.nam" to set your "SITE" info and preferred options. You will need to have a date range and a 16 digit hex password. If you do not already have this info, please contact CBL on: Voice: +44 (1656) 652222 Fax: +44 (1656) 652227 Email: support@cbl.com # textedit selcopy.nam & Having saved your changes, try verifying the Release and Build Level. # selcopy -v -------- Your install is now finished -------- and you are ready to run. Thank you. * SELCOPY/LNZ Test Drive 1 * *** Supply all ctl stmts at the console when selcopy asks for them. Just invoke selcopy with no arguments and no input redirection. % selcopy The selcopy program will respond with the following: SELCOPY/LNZ n.nn at Your Installation Name - Locn yyyy/mm/dd hh:mm Enter Selcopy Ctl Cards... (Use /* to end.) You should then enter your selcopy control cards at the keyboard, using the enter key to terminate each line. Multiple selcopy statements may be entered using selcopy's default separator char, "!". Special chars such as ! $ * ' " and all the rest of the meta chars (including \ the escape char) will not be interpreted by the shell because the data is read directly by selcopy. To read this file, "readme.lnz", from the current dir, and display on the terminal all the commands used for this install, and at the same time write them to the file "z.z", your response lines would be: read readme.lnz * You have to key this in and hit enter. if p 1 = # * and this. t log s=22 * and this. (Log each rec (stopaft=22) to screen.) t wr z.z * and this. (Write all recs to the file "z.z".) end * The "end" statement to terminate input. * Could use /* or ^D to do the same thing as "end". To read the executable binary file, "/usr/bin/ls", and display the 1st 5 recs in TYPE=B (both char and hex) on the terminal and 55 recs on selcopy's print file, treating the input data as fixed length 64 byte recs, your response lines would be: rd /usr/bin/ls l=64 pr ty=b s=55 * Print output goes to ./SELC.LST by default. log ty=b s=5 ! e * "e" is abbrev for "end". (Same as "/*" in pos 1.) * SELCOPY/LNZ Test Drive 2 * *** Supply all ctl stmts on the command line when invoking selcopy. The first "!" in the arg string tells selcopy that ctl stmts follow, where stmts are separated by further "!" chars. The following command duplicates the example in Test Drive 1: % selcopy ! read readme.lnz! if p 1 = #! t log s=22! t wr z.z! end Because selcopy's linend is an exclamation mark, care must be taken to ensure that every ! for selcopy is followed by a blank, otherwise it will get interpreted by the /bin/csh shell as a recall of a previous command. When a blank is not possible, the ! must be preceded by a \ character (the escape char) to get the shell to treat the ! as data. A further shell problem is that any quotes intended for selcopy need to be enclosed in quotes of the other kind in order to protect selcopy's quotes from the shell. Single or double quotes may be used either way round. The inner quotes are then passed intact to selcopy by the shell. Similarly, meta chars, such as "*", must also be in quotes or escaped with the "\" escape char. % selcopy ! in ./selcopy.msg! if pos any = "'RECOG'"! t log s=4 \!"/*" It is better to use of "end" instead of "/*" to terminate control card data because it makes it easier to key in and more readable: % selcopy ! in ./selcopy.msg! if pos any = '"RECOG"'! t log s=4! end * SELCOPY/LNZ Test Drive 3 * *** Supply all ctl stmts from a file. Say we edited a new file, "/tmp/x", to contain the following: * Sample selcopy control cards for Test Drive 3. read ./selcopy.msg lrecl=40 * Fixed Length, 40. log type=m stopaft=4 * To check LF or CRLF. if p any = 'RECOG' then p @ = 'recog' * Selective changes. then print ty=m s=7 wr /tmp/selcopy.msg.frigged eol=no We can then run selcopy, redirecting it's control card input from that file: % selcopy < /tmp/x To check selcopy's listing file and the output file: % more ./SELC.LST % more /tmp/selcopy.msg.frigged Alternatively, we could set up a script file called "test3", using the shell facility to redirect input from data within the shell, containing: # "test3" - Script file of selcopy control cards for Test Drive 3. # Remove the \ from =\EOF= to get shell substitution on ctl cards. selcopy << =\EOF= * Sample selcopy control cards for Test Drive 3. read ./selcopy.msg lrecl=40 * Fixed Length, 40. log type=m stopaft=4 * To check LF or CRLF. if p any = 'RECOG' then p @ = 'recog' * Selective changes. then print ty=m s=7 wr /tmp/selcopy.msg.frigged eol=no =\EOF= exit $status To run this script, we then simply issue the command "test3". * SELCOPY/LNZ Test Drive 4 * *** Supply all ctl stmts from an existing file, but also pass some args. Consider an existing file, "localEOL", which is an ascii text file on the ctl directory of your current directory, consisting of the following 3 lines only: * This is a comment line in the selcopy ctl card file, "localEOL". read %1 * Read the 1st file, arg 1 off the command line. write %2 * Write the 2nd file, arg 2. Suppose you have a file, "dos.data" which is an ascii file, but has CRLF as linend, instead of LF, and you wish to create a copy in local unix format, then either of the following 2 commands will fix it: % selcopy