Shell Scripts

(files are shown in alphabetical order)
Shortcut to shell script purposes

Shell scripts

(create list of scripts using the following command)
$ ls -l * | fgrep -v . | gawk '{print substr($0,34)}' > sclist.txt

(create index using this command)
$ crindex $(ls * | fgrep -v . ) > @index.txt

(incorporate the above list into sclist.html and then create sclist2.html as follows)
$ sed -e 's%\([0-9][0-9] \)\([a-z,0-9,_]*\)\(</tt>$\)%\1<a href="./scripts/\2" target="_blank">\2</a>%' \
-e 's%\(^<p><tt>\)\([a-z,0-9][a-z,0-9,_]*\)\([ ,(\&nbsp;)]\)%\1<a href="./scripts/\2" target="_blank">\2</a>\3%' \
scrlist.html > scrlist2.html
 
Nov  1  2006 a4lsps
Nov  1  2006 a4ps
Nov  1  2006 a4ps2pdf
Jul 29  2007 alltitles
Nov  1  2006 antigrep
Nov  1  2006 badchars
Nov  1  2006 baddrug
Nov  1  2006 badinc
Nov  1  2006 badlines
Nov  1  2006 badprognames
Mar  4  2007 badprot
Nov  1  2006 badtitlesprogs
Nov  1  2006 biglis
Nov  1  2006 bigps
Jul 15  2007 bigxlis
Jul 15  2007 bigxps
Nov  1  2006 catp
Mar  2  2007 checktitles
Mar  2  2007 checktitles_win
Feb 11  2007 clash
Feb 11  2007 clash_win
Jan 15  2007 cmprc
Nov  1  2006 colonend
Nov  1  2006 compdirs
Nov  1  2006 compfl
Feb  7  2007 contents
Feb 11  2007 contents_win
Feb  7  2007 contentsl
Feb 11  2007 contentsl_win
Feb 11  2007 crindex
Feb 11  2007 crindex_win
Jun 25  2007 crprottmpl
Jul 20  2007 crtitlesds
Jul 20  2007 crtitlesds_win
Jul 20  2007 crtitlestmpl
Nov  1  2006 dashes
Nov 24  2006 ddiff
Nov  1  2006 derorder
Nov  1  2006 derprogs
Nov  1  2006 digits2x
Feb 18  2007 dirtree
Nov  1  2006 donefiles
Feb 23  2007 donepages
Nov  1  2006 donesectchk
Nov  1  2006 emailaddr
Nov  1  2006 emailme
Nov  1  2006 fext
Nov  1  2006 filesize
Feb 11  2007 fsv
Feb 11  2007 fsvacct
Feb 11  2007 fsvdc
Nov  1  2006 fsvraw
Nov  1  2006 fullrunsuite
Mar  4  2007 getfields
Nov  1  2006 gethome
Nov  1  2006 getitles
Nov  1  2006 getitles_sas
Mar  2  2007 getlayout
Mar  2  2007 getlayout_win
Feb 23  2007 getlsps
Feb 18  2007 getname
Nov  1  2006 grename
Nov  1  2006 greplace
Mar  4  2007 hdr
Nov  1  2006 hexchars
Feb 20  2007 hexcnt
Nov  1  2006 idiff
Mar  2  2007 intitlabels
Mar  2  2007 intitlabels_win
Mar  2  2007 intitlesds
Mar  2  2007 intitlesds_win
Jul 19  2007 intitlis
Jul 19  2007 intitlis_win
Feb 11  2007 intnolis
Nov  1  2006 intnop
Nov  1  2006 justhdr
Feb 21  2007 layout2lsps
Feb 20  2007 linesize
Feb 20  2007 linesize_win
Mar 11  2007 lis
Nov  1  2006 lis2owner
Mar  2  2007 lis2ps
Jul 20  2007 lisremap
Jul 21  2007 lisremap_win
Nov  1  2006 listempty
Mar  4  2007 lmhdr
Mar 11  2007 log
Mar 11  2007 lst
Nov  1  2006 macrocalls
Jul 19  2007 makemyrun
Jul 19  2007 makerun
Jul 19  2007 makexrun
Feb 18  2007 mhdr
Feb 20  2007 misscnt
Feb 20  2007 misscnt_win
Feb 20  2007 missvars
Feb 20  2007 missvars_win
Nov  1  2006 multilinks
Nov  1  2006 mybaddrug
Nov  1  2006 mybadinc
Nov  1  2006 mybadprognames
Mar  4  2007 mybadprot
Nov  1  2006 mybadtitlesprogs
Mar 11  2007 myderchk
Nov  1  2006 mydonefiles
Nov  1  2006 myfiles
Nov  1  2006 mynewlis
Nov  1  2006 mynewprogs
Nov  1  2006 mynewtitles
Nov  1  2006 myop
Nov  1  2006 myorphans
Nov  1  2006 myps
Mar 11  2007 myrepchk
Nov  1  2006 newix
Feb 11  2007 nobs
Feb 11  2007 nobs_win
Nov  1  2006 nofile
Nov  1  2006 nofootline
Nov  1  2006 not664
Nov  1  2006 numtest
Mar  4  2007 ohdr
Mar 11  2007 olis
Mar 11  2007 opgm
Nov  1  2006 oplist
Nov  1  2006 oporder
Nov  1  2006 opsortkey
Nov  1  2006 orphans
Mar 11  2007 otitles
Nov  1  2006 owner
Nov  1  2006 pages
May 16  2007 pagexofy
Feb 13  2006 pathscr
Mar 11  2007 pgm
Jul 22  2007 prefix
Feb 11  2007 printall
Feb 11  2007 printall_win
Nov  1  2006 printpdfbookmarks
Nov  1  2006 pstolp
Jun 12 08:29 quotelst
Nov  1  2006 reflist2lis
Nov  1  2006 reflist2progs
Nov  1  2006 rem
Nov  1  2006 rescue
Nov  1  2006 rescuedonelist
Nov  1  2006 ruler
Nov  1  2006 runproblems
Feb 17  2007 sasb
Jan 13  2008 sasu
Nov  1  2006 sasunixskeleton
Feb 17  2007 scanlogs
Nov  1  2006 shdr
Feb 22  2007 showfmt
Feb 22  2007 showfmt_win
Feb 20  2007 showfmts
Feb 22  2007 showfmts_win
Feb 11  2007 showlfmt
Feb 11  2007 showlfmt_win
Feb 11  2007 showlfmts
Feb 11  2007 showlfmts_win
Mar 15  2007 showme
Mar  7  2007 showprot
Mar  7  2007 showprot_win
Jul 19  2007 showtitles
Jul 19  2007 showtitles_win
Nov  1  2006 slinks
Nov  1  2006 sohdr
Nov  1  2006 sortnpref
Nov  1  2006 splitbiglst
Nov  1  2006 suffix
Feb  7  2007 summary
Feb 11  2007 summary_win
Feb 27  2007 testemail
Nov  1  2006 timestamp
Mar 11  2007 titles
Nov  1  2006 titlesvsbkmarks
Nov  1  2006 toclis
Nov  1  2006 toupper
Feb 20  2007 userfmts
Feb 20  2007 userfmts_win
Nov  1  2006 uslsps
Nov  1  2006 usps
Nov  1  2006 usps2pdf
Nov  1  2006 vop
Nov  1  2006 vtitles
Nov  1  2006 whosgot
Nov  1  2006 wt

Shell script purposes

Index of members in this directory with standard headers
========================================================
(this list was generated by the crindex script)

a4lsps             - Calculate and display linesize and pagesize values for different
                     layouts based on A4 paper and margins.

                     Usage: a4lsps -l 1.0 -r 1.0 -t 1.0 -b 1.0

a4ps               - For paged adhoc reports that are not part of the reporting
                     system, create an A4 postscript file (and optionally print it).

                     Usage: a4ps file.lst > file.ps
                     a4ps file1.lst file2.lis subdir/file3.lst > file.ps
                     a4ps -p john file.lst
                     a4ps -p mika file1.lst file2.lst
                     a4ps -t 0.75 -p john file.lst
                     a4ps -b 0.5 -s 2 -e 3 -p john file.lst

a4ps2pdf           - To convert an A4 postscript file to a pdf

                     Usage: a4ps2pdf file.ps file.pdf
                     a4ps2pdf file.ps
                     a4ps2pdf -u file.ps   # creates uncompressed pdf

alltitles          - Script to collect all the valid .titles files together and put
                     them all in ALL.TITLES

                     Usage: alltitles

antigrep           - To list all files that DO NOT contain a specified string

                     Usage: antigrep 'FG_21_08' *.sas
 

badchars           - Show bad characters (not clean 7 bit) in the input stream

                     Usage: badlines file.ext | badchars
 

baddrug            - To list which SAS programs do not have a correct drug name
                     in the standard header.

                     Usage: baddrug
 

badinc             - To list which SAS programs do not have a correct increment
                     in the standard header.

                     Usage: badinc
 

badlines           - Production script to find lines in a text file containing bad
                     characters (i.e. not clean 7 bit)

                     Usage: badlines file.ext
                     badlines file.ext | badchars

badprognames       - To list which SAS programs do not have a correct program name
                     in the standard header.

                     Usage: badprognames
 

badprot            - To list which SAS programs do not have a correct protocol
                     in the standard header.

                     Usage: badprot
 

badtitlesprogs     - To list which titles members do not have a matching program name

                     Usage: badtitlesprogs
 

biglis             - To produce a collection of all the .lis files in donelist.txt in
                     sorted order, optionally with a table of contents at the start.

                     Usage: biglis > big.lis
                     biglis -t > tocbig.lis
                     biglis -t1 > tocbig.lis
                     biglis -s > big.lis
                     biglis -o > bigforword.lis
                     biglis -n 2 > big2.lis
                     biglis -e 3 > big3pages.lis

bigps              - Production script to convert *.lis* files listed in donelist.txt
                     (or listed in a donelist section file) to one large postscript
                     file.

                     Usage: bigps > big.ps
                     bigps -1 > big.ps
                     bigps -s > selbig.ps
                     bigps -r -s > selbig.ps
                     bigps -n 2 > big2.ps

bigxlis            - To produce a collection of all the .lis files in xdonelist.txt
                     in sorted order, optionally with a table of contents at the
                     start.

                     Usage: bigxlis > xbig.lis
                     bigxlis -t > tocxbig.lis
                     bigxlis -t1 > tocxbig.lis
                     bigxlis -s > xbig.lis
                     bigxlis -o > xbigforword.lis
                     bigxlis -n 2 > xbig2.lis
                     bigxlis -e 3 > xbig3pages.lis

bigxps             - Production script to convert *.lis* files listed in xdonelist.txt
                     (or listed in a xdonelist section file) to one large postscript
                     file.

                     Usage: bigxps > bigx.ps
                     bigxps -1 > bigx.ps
                     bigxps -s > selbigx.ps
                     bigxps -r -s > selbigx.ps
                     bigxps -n 2 > bigx2.ps

catp               - To "cat" files and add page throws to the start of all but the
                     first file.

                     Usage: catp *.lst > all.lis
 

checktitles        - Production script to check the titles in the titles dataset
                     (uses SAS).

                     Usage: checktitles

checktitles_win    - Production script to check the titles in the titles dataset
                     (uses SAS).

                     Usage: checktitles_win

clash              - To identify mismatches in variable properties between datasets
                     (uses SAS).

                     Usage: clash
 

clash_win          - To identify mismatches in variable properties between datasets
                     (uses SAS).

                     Usage: clash_win
 

cmprc              - To run "cmp" and echo the return code

                     Usage: cmprc file1 file2
                     cmprc -s file1 file2

colonend           - To show lines that end with a colon

                     Usage: colonend *.sas
 

compdirs           - To compare the contents of two directories

                     Usage: compdirs . /there
 

compfl             - To compare two floating point numbers

                     Usage: compfl  1.2  3.4
                     compfl 355/113 3.14159
                     compfl 3*1.33  3.99
                     if [ "$(compfl 1.2 3.4)" == "LT" ] ; then
                     print "less than"
                     fi

contents           - To list the contents (in short form) of one or more SAS datasets
                     (or a whole library) in the current directory (uses SAS).

                     Usage: contents adv
                     contents adv acct
                     contents    # all datasets are listed

contents_win       - To list the contents (in short form) of one or more SAS datasets
                     (or a whole library) in the current directory (uses SAS).

                     Usage: contents_win adv
                     contents_win adv acct
                     contents_win    # all datasets are listed

contentsl          - To list the contents (in long form) of one or more SAS datasets
                     (or a whole library) in the current directory (uses SAS).

                     Usage: contentsl adv
                     contentsl adv acct
                     contentsl    # all datasets are listed

contentsl_win      - To list the contents (in long form) of one or more SAS datasets
                     (or a whole library) in the current directory (uses SAS).

                     Usage: contentsl_win adv
                     contentsl_win adv acct
                     contentsl_win    # all datasets are listed

crindex            - To create an index of macros or scripts with standard headers
                     (uses SAS).

                     Usage: crindex * > @index.txt
                     crindex *.sas > @index.txt

crindex_win        - To create an index of macros or scripts with standard headers
                     (uses SAS).

                     Usage: crindex_win * > @index.txt
                     crindex_win *.sas > @index.txt

crprottmpl         - Production script to create file "protocol.template" in the study
                     programs directory.

                     Usage: crprottmpl

crtitlesds         - Production script to create the titles dataset from the
                     .titles files and the protocol dataset from the protocol.txt file
                     (uses SAS).

                     Usage: crtitlesds

crtitlesds_win     - Production script to create the titles dataset from the
                     .titles files and the protocol dataset from the protocol.txt file
                     (uses SAS).

                     Usage: crtitlesds_win

crtitlestmpl       - Production script to create file "titles.template" in the study
                     programs directory.

                     Usage: crtitlestmpl

dashes             - To list files that have spanning dashed lines in them

                     Usage: dashes *.lis
                     owner $(dashes *.lis)  # lists the owner in front of file name

ddiff              - Production script to compare identically named files with those
                     in another directory (default is parent directory)

                     Usage: ddiff -i "^OUTPUT" *.LST > differ.txt
                     ddiff -i "^Report No" *.lis > differ.txt
                     ddiff -i "^Report No" -d /aaa/bbb/ccc *.lis > differ.txt
                     ddiff -i ^Report -q > changedfiles.txt

derorder           - Production script to list the programs that build the derived
                     datasets in the order in which they will be run.

                     Usage: derorder

derprogs           - To list all valid derived dataset build programs

                     Usage: derprogs s_myprog.sas d_myprog2.sas
                     myfiles [sd]*.sas | derprogs
                     derprogs   (interactive -- use Ctrl-D to end)

digits2x           - To change numeric values in a report to "x"s to make it
                     suitable for a table shell.

                     Usage: digits2x report.lis > template.txt
 

dirtree            - Display the directory tree structure downwards from the current
                     directory.

                     Usage: dirtree
 

donefiles          - Production script to list out the files in donelist.txt

                     Usage: donefiles
                     lis2ps -p john $(donefiles)
                     cp -p $(donefiles) statusYYMMDD

donepages          - Production script to read in a donelist file and output with the
                     number of pages at the end.

                     Usage: donepages donelist.tmp > donepages.txt

donesectchk        - To check that the donelist section files have all the entries in
                     donelist.txt

                     Usage: donesectchk

emailaddr          - Production script to create an email address out of a Unix userid

                     Usage: emailaddr userid
                     emailaddr -i userid
                     sendto=$(emailaddr userid)

emailme            - To email a user the requested files

                     Usage: emailme t_xxx.lis
                     emailme t_x*.lis
                     emailme $(myfiles t*.lis)
                     emailme -i $(myfiles t*.lis)
                     emailme -u rrash $(myfiles t*.lis)

fext               - list all unique file extensions in the current directory

                     Usage: fext
 

filesize           - Production script to show file size

                     Usage: filesize file.ext
 

fsv                - To launch fsview to browse a SAS dataset in the current directory
                     (uses SAS).

                     Usage: fsv demog
                     fsv demog.sas7bdat
 

fsvacct            - To launch fsview to browse a SAS dataset in the current directory
                     with fields from the acct dataset included (Uses SAS)

                     Usage: fsvacct adv patno begindt ldosedt
                     fsvacct demog.sas7bdat patno begindt ldosedt
 

fsvdc              - To launch fsview to browse a SAS dataset in the current directory
                     with user-formatted variables decoded into a __D field (Uses SAS)

                     Usage: fsvdc demog
                     fsvdc demog.sas7bdat
 

fsvraw             - To launch fsview to browse a SAS dataset in the current directory
                     (without user-defined formats applied) (uses SAS).

                     Usage: fsvraw demog
                     fsvraw demog.sas7bdat
 

fullrunsuite       - Production script to run "runsuite" and save the standard and
                     error output.

                     Usage: fullrunsuite

getfields          - To display the client, office, drug, study and increment from
                     the current directory separated by forward slashes.

                     Usage: getfields
 

gethome            - Production script to return the home directroy of a user, given
                     a userid.

                     Usage: gethome
                     gethome userid

getitles           - Production script to extract the titles from an output listing

                     Usage: getitles file.ext
                     getitles -b file.ext     # enclose in brackets
                     getitles -1 file.ext     # one title only

getitles_sas       - To extract the titles from an output listing (use SAS)

                     Usage: getitles_sas filename.ext
 

getlayout          - Production script to get layout details for a .lis output
                     (Uses SAS).

                     Usage: getlayout filename.lis
 

getlayout_win      - Production script to get layout details for a .lis output
                     (Uses SAS).

                     Usage: getlayout_win filename.lis
 

getlsps            - To determine the line size, page size and number of pages of an
                     output listing.

                     Usage: getlsps file.ext
 

getname            - Production script to return the name of a user, given a userid

                     Usage: getname
                     getname userid

grename            - To do a bulk rename of files replacing one name part with another
                     for files owned by you.

                     Usage: grename adult adu *.sas
                     grename child ped *.sas *.titles

greplace           - To replace a string with another string in the files listed
                     that are owned by you.

                     Usage: greplace "this string" "that string" *.sas
                     greplace '\stat\' '/STAT/' *.sas
                     WARNING: Always back up your files before using this

hdr                - To create a standard SAS program header

                     Usage: hdr
                     hdr progname

hexchars           - To display hex characters in a text file (uses SAS)

                     Usage: hexchars file.ext
 

hexcnt             - Display character variables with their number of observations
                     containing hex characters.

                     Usage: hexcnt ds1 ds2
                     hexcnt

idiff              - To compare files with "diff" but saying which lines to ignore

                     Usage: idiff -i "^OUTPUT" file1.ext file2.ext > differ.txt
                     idiff -i "^Report No" file1.ext file2.ext > differ.txt

intitlabels        - Production script to list all the programs in the titles dataset
                     with output labels (uses SAS).

                     Usage: intitlabels
 

intitlabels_win    - Production script to list all the programs in the titles dataset
                     with output labels (uses SAS).

                     Usage: intitlabels_win
 

intitlesds         - Production script to list all the programs in the titles dataset
                     (uses SAS).

                     Usage: intitlesds
 

intitlesds_win     - Production script to list all the programs in the titles dataset
                     (uses SAS).

                     Usage: intitlesds_win
 

intitlis           - Production script to list all the programs in the titles dataset
                     with corresponding lis filenames (uses SAS).

                     Usage: intitlis
 

intitlis_win       - Production script to list all the programs in the titles dataset
                     with output labels (uses SAS).

                     Usage: intitlis_win
 

intnolis           - Production script to list outputs in the titles file with no
                     corresponding .lis output in the current directory.

                     Usage: intnolis

intnop             - Production script to list programs in the titles file with no
                     corresponding sas program in the current directory.

                     Usage: intnop

justhdr            - To select just the header of a sas program or script

                     Usage: justhdr filename
                     justhdr *.sas

layout2lsps        - Production script to calculate sas linesize and pagesize values
                     based on paper type, margins and layout.

                     Usage: layout2lsps -l 1.0 -r 1.0 -t 1.0 -b 1.0 -p A4 -f LC12

linesize           - To show the linesize for a sas program in the titles dataset
                     (uses SAS).

                     Usage: linesize progname
                     linesize

linesize_win       - To show the linesize for a sas program in the titles dataset
                     (uses SAS).

                     Usage: linesize_win progname
                     linesize_win

lis                - To view the .lis output file of the program defined to the
                     exported variable "prog".

                     Usage: lis

lis2owner          - To search .lis files for a given literal string (in any case)
                     and return owner of the corresponding .titles member

                     Usage: lis2owner "literal string"
 

lis2ps             - Production script to convert a .lis file to postscript and
                     optionally route it to a printer.

                     Usage: lis2ps filename.lis > filename.ps
                     lis2ps -1 filename.lis > filename.ps
                     lis2ps -p john filename.lis
                     lis2ps -p john vt_patdem*.lis
                     lis2ps -p john ´myfiles *.lis´
                     lis2ps -p john -b 2 -e 4 filename.lis

lisremap           - Production script to list all the outputs file names that have
                     been remapped in a .titles "lisfile:" line (uses SAS).

                     Usage: lisremap
 

lisremap_win       - Production script to list all the outputs file names that have
                     been remapped in a .titles "lisfile:" line (uses SAS).

                     Usage: lisremap_win
 

listempty          - To list "empty" files

                     Usage: listempty *.lis
 

lmhdr              - To create a standard SAS macro header for a local macro

                     Usage: lmhdr
                     lmhdr progname

log                - View the .log file of the program defined to the exported
                     variable "prog".

                     Usage: log

lst                - To view the .lst output file of the program defined to the
                     exported variable "prog".

                     Usage: lst

macrocalls         - To extract a list of macros called in a SAS log (assuming MLOGIC
                     option is set).

                     Usage: macrocalls progname.log
 

makemyrun          - Create scripts named "runder$USER" and "runrep$USER" for running
                     all the programs of a user to build derived datasets and produce
                     reports.

                     Usage: makemyrun

makerun            - Production script to create scripts named "runderived",
                     "runreports" and "runsuite" used for running all the programs
                     in a study.

                     Usage: makerun

makexrun           - Script to create script named "runxreports" used for running all
                     the "extra analysis" programs in a study.

                     Usage: makexrun

mhdr               - To create a standard SAS macro header

                     Usage: mhdr
                     mhdr progname

misscnt            - Display a count of variables and their number of missing
                     observations (uses SAS)

                     Usage: misscnt ds1 ds2
                     misscnt

misscnt_win        - Display a count of variables and their number of missing
                     observations (uses SAS)

                     Usage: misscnt_win ds1 ds2
                     misscnt_win

missvars           - List all-missing variables (uses SAS)

                     Usage: missvars  ds1 ds2
                     missvars

missvars_win       - List all-missing variables (uses SAS)

                     Usage: missvars_win  ds1 ds2
                     missvars_win

multilinks         - To create individual links to members of a directory

                     Usage: multilinks /xxx/dir
                     multilinks -s '*.sas' /xxx/dir  # file pattern MUST BE QUOTED

mybaddrug          - To list which of your own SAS programs do not have a correct
                     drug name in the standard header.

                     Usage: mybaddrug
                     mybaddrug -f

mybadinc           - To list which of your own SAS programs do not have a correct
                     increment in the standard header.

                     Usage: mybadinc
                     mybadinc -f

mybadprognames     - To list which of your own SAS programs do not have a correct
                     program name in the standard header.

                     Usage: mybadprognames
                     mybadprognames -f

mybadprot          - To list which of your own SAS programs do not have a correct
                     protocol in the standard header.

                     Usage: mybadprot
                     mybadprot -f

mybadtitlesprogs   - To list which of your own titles members do not have a matching
                     program name entry.

                     Usage: badtitlesprogs
 

myderchk           - Scans runderived.chk to show you details that belong to your
                     own program's log files (based on .sas file ownership)

                     Usage: myderchk
                     myderchk -u rrash

mydonefiles        - To list out the files in the donelist belonging to a person

                     Usage: mydonefiles
                     cp $(mydonefiles) /xxx/yyy
                     lis2ps -e 4 -p john $(mydonefiles)
                     mydonefiles rrash

myfiles            - To print out a list of user-owned files

                     Usage: myfiles
                     myfiles [sd]*.sas
                     myfiles -u rwolf s*.sas

mynewlis           - To list all user-owned .lis files created since the last
                     "timestamp" command was issued.

                     Usage: mynewlis
                     cp $(mynewlis) /new/dir

mynewprogs         - To list all user-owned .sas files created or updated
                     since the last "timestamp" command was issued.

                     Usage: mynewprogs
                     cp $(mynewprogs) /new/dir

mynewtitles        - To list all user-owned .titles files created or updated
                     since the last "timestamp" command was issued.

                     Usage: mynewtitles
                     cp $(mynewtitles) /new/dir

myop               - To list output files owned by the user in table reference order

                     Usage: myop t*.lis
                     myop *.LST

myorphans          - List user's files with no entry in the titles dataset

                     Usage: myorphans
                     \rm $(myorphans)

myps               - List all processes for the invoking user or another user

                     Usage: myps
                     myps otheruser

myrepchk           - Scans runreports.chk to show you details that belong to your
                     own program's log files (based on .titles file ownership)

                     Usage: myrepchk
                     myrepchk -u rrash

newix              - To run "crindex" to create a new index named @index.txt

                     Usage: newix
 

nobs               - To display the number of observations a dataset has (uses SAS)

                     Usage: nobs       # acts on all datasets in current library
                     nobs p*    # acts on all datasets starting with "p"
                     nobs dem labs   # acts on two datasets
                     nobs dem        # acts on one dataset

nobs_win           - To display the number of observations a dataset has (uses SAS)

                     Usage: nobs_win       # acts on all datasets in current library
                     nobs_win p*    # acts on all datasets starting with "p"
                     nobs_win dem labs   # acts on two datasets
                     nobs_win dem        # acts on one dataset

nofile             - Production script to echo a file name if it does not exist

                     Usage: cat filelist | nofile

nofootline         - To detect output files with no solid footnote line

                     Usage: nofootline la_*.lis
 

not664             - List all files in the current directory that do not have 664
                     permission

                     Usage: not664
                     not664 *.sas

numtest            - Test a string for being an valid integer or decimal number

                     Usage: numtest 12a3.45 ; echo $?

ohdr               - To create an old-style standard SAS program header

                     Usage: ohdr
                     ohdr progname

olis               - To view the original .lis output file of the program being
                     validated (as defined to "prog" but without the "v" or "v_"
                     prefix).

                     Usage: olis

opgm               - To view the original .sas file of the program being validated
                     (as defined to "prog" but without the "v" or "v_" prefix).

                     Usage: opgm

oplist (o/p list)  - To create a list of tables/appendices and the output file names

                     Usage: oplist *.LST
                     oplist t*.lis

oporder            - To put a list of outputs in table reference order

                     Usage: oporder *.lis
                     oporder t*fadu*.lis

opsortkey          - To create an output sort key from the table/appendix reference
                     number.

                     Usage: sortkey=$(echo 7.12 | opsortkey)
 

orphans            - List files with no entry in the titles dataset

                     Usage: orphans
 

otitles            - To view the original .titles file of the program being validated
                     (as defined to "prog" but without the "v" or "v_" prefix).

                     Usage: otitles

owner              - To display the owner of a file followed by the file name

                     Usage: owner s*.sas
                     derorder | owner

pages              - Production script to print pages of a given range

                     Usage: pages -b 2 -e 5 filename
                     pages -b1 -e2 *.lis

pagexofy           - Add "Page x of Y" labels to a file

                     Usage: pagexofy infile > outfile

pathscr            - List all files with no file extension defined to the PATH system
                     environment variable.

                     Usage: pathscr

pgm                - To edit the program defined to the exported variable "prog".

                     Usage: pgm

prefix             - To prefix a list of items with a given string

                     Usage: ls -1 x_*.sas | prefix 'sasb '

printall           - To print all observations in datasets in the current directory
                     that satisfy a condition (uses SAS).

                     Usage: printall patno="1234"
                     printall patient=1234 > pat1234.txt
                     printall -e labs patient=1234 > save.txt
                     printall -i 'demog vit' patient=1234
                     printall -e vit 'visitcd>9083'
                     printall diagdt="'23sep2003'"d

printall_win       - To print all observations in datasets in the current directory
                     that satisfy a condition (uses SAS).

                     Usage: printall_win patno="1234"
                     printall_win patient=1234 > pat1234.txt
                     printall_win -e labs patient=1234 > save.txt
                     printall_win -i 'demog vit' patient=1234
                     printall_win -e vit 'visitcd>9083'
                     printall_win diagdt="'23sep2003'"d

printpdfbookmarks  - To list all the PDF bookmarks in a pdf file

                     Usage: printpdfbookmarks BIG2.pdf
                     printpdfbookmarks BIG2.pdf > bookmarks2.txt

pstolp             - Production script to convert a postscript document to plain text

                     Usage: pstolp big.ps > big.txt
 

quotelst           - To put all arguments in double quotes

                     Usage: quotelst C:\mylib\*

reflist2lis        - To turn a list of table/appendix reference numbers into their
                     output file names, assuming output files end with ".lis" .

                     Usage: reflist2lis reflist.txt
                     reflist2lis reflist.txt > newlist.txt

reflist2progs      - To turn a list of table/appendix reference numbers into their sas
                     program name that creates them.

                     Usage: reflist2progs reflist.txt
                     reflist2progs reflist.txt > newlist.txt

rem                - Production script to delete files but only if they have group
                     write permission.

                     Usage: rem *.sas7bdat

rescue             - To get back the source code of SAS programs from their logs

                     Usage: rescue myprog
                     rescue myprog1.log myprog2.log
                     rescue l*.log

rescuedonelist     - To rescue a deleted donelist.txt file

                     Usage: rescuedonelist filelist.txt
 

ruler              - To echo a line with markers at 10 column intervals

                     Usage: ruler
 

runproblems        - Production script to check error files for run problems

                     Usage: runproblems runreports.err
                     runproblems runderived.err

sasb               - Production script to run sas in batch and give a completion
                     message and a diagnostics .chk file.

                     Usage: sasb progname
                     sasb progname.sas
                     sasb

sasu               - Production script to run sas in batch and give a completion
                     message and a diagnostics .chk file.

                     Usage: sasu progname
                     sasu progname.sas
                     sasu

sasunixskeleton    - To create a skeleton Unix shell script that runs SAS

                     Usage: sasunixskeleton
                     sasunixskeleton myscript

scanlogs           - Production script to scan SAS logs for errors, warnings and other
                     important messages.

                     Usage: scanlogs *.log
                     scanlogs myprog
                     scanlogs myprog.log
                     scanlogs

shdr               - To create a standard shell script header

                     Usage: shdr
                     shdr scriptname

showfmt            - To display the contents of a format that would be made available
                     if a call %allocr were made (uses SAS).

                     Usage: showfmt age
                     showfmt \$cat

showfmt_win        - To display the contents of a format that would be made available
                     if a call %alloc were made (uses SAS).

                     Usage: showfmt_win age
                     showfmt_win \$cat

showfmts           - To display a list of all stored formats that would be available
                     if a call to %allocr were made from the current directory
                     (uses SAS).

                     Usage: showfmts
 

showfmts_win       - To display a list of all stored formats that would be available
                     if a call to %allocr were made from the current directory
                     (uses SAS).

                     Usage: showfmts_win
 

showlfmt           - To display the contents of a format stored in the current
                     directory in a catalog named FORMATS (uses SAS).

                     Usage: showlfmt age
                     showlfmt \$cat
 

showlfmt_win       - To display the contents of a format stored in the current
                     directory in a catalog named FORMATS (uses SAS).

                     Usage: showlfmt_win age
                     showlfmt_win \$cat
 

showlfmts          - To display a list of formats stored in the current directory
                     in a catalog named FORMATS (uses SAS).

                     Usage: showlfmts
 

showlfmts_win      - To display a list of formats stored in the current directory
                     in a catalog named FORMATS (uses SAS).

                     Usage: showlfmts_win
 

showme             - To display the header of a sas macro or script or display the
                     index of the script or macro directory.

                     Usage: showme titles.sas
                     showme sasb
                     showme scripts
                     showme macros

showprot           - To list the contents of the protocol dataset (uses SAS)

                     Usage: showprot

showprot_win       - To list the contents of the protocol dataset (uses SAS)

                     Usage: showprot_win

showtitles         - To list the titles for a program(s) in the titles dataset
                     (uses SAS).

                     Usage: showtitles progname
                     showtitles

showtitles_win     - To list the titles for a program(s) in the titles dataset
                     (uses SAS).

                     Usage: showtitles_win progname
                     showtitles_win

slinks             - To list all symbolic links in the current directory and downwards

                     Usage: slinks

sohdr              - To create a standard shell script (with options) header

                     Usage: sohdr scriptname
                     sohdr

sortnpref          - Production script to sort a list using a numeric prefix as the
                     main key.

                     Usage: ls *[0-9]_*.sas | sortnpref

splitbiglst        - Production script to split a big .lst file into separate files

                     Usage: splitbiglst t_output.lis
 

suffix             - To suffix a list of items with a given string

                     Usage: xxxxx | suffix '.sas'

summary            - To run "proc summary" on a dataset and display the output data
                     set (uses SAS).

                     Usage: summary sex acct
                     summary 'sex agesub' acct
                     summary 'sex agesub' 'acct(where=(fascd=1))'
                     summary 'sex agesub' 'acct(where=(fascd=1))' 'where _freq_>20'

summary_win        - To run "proc summary" on a dataset and display the output data
                     set (uses SAS).

                     Usage: summary_win  sex acct
                     summary_win 'sex agesub' acct
                     summary_win 'sex agesub' 'acct(where=(fascd=1))'
                     summary_win 'sex agesub' 'acct(where=(fas=1))' 'where _freq_>20'

testemail          - To test the script email method to see if it can send you an email

                     Usage: testemail
 

timestamp          - To create a file in the home directory so it can be used as a
                     time stamp for determining files created after it.

                     Usage: timestamp
 

titles             - To create the titles file defined to "prog" and to edit it if a
                     call to an editor is made.

                     Usage: titles

titlesvsbkmarks    - Production script to display table/appendix reference numbers in
                     ALL.TITLES that can not be found in the PDF bookmarks.

                     Usage: titlesvsbkmarks ONE.pdf TWO.pdf
                     titlesvsbkmarks BIG*.pdf

toclis             - Production script to create a "table of contents" for all the
                     .lis files specified in donelist.txt or a donelist section file
                     in sorted report-id order.

                     Usage: toclis > toc.txt
                     toclis -n 2 > toc2.txt
                     toclis -s 'ta_*' > tocta.txt

toupper            - Production script to convert lower case to upper case

                     Usage: toupper string

userfmts           - To list variables with a user format assigned (uses SAS)

                     Usage: userfmts adv
                     userfmts adv acct
                     userfmts    # all datasets are listed

userfmts_win       - To list variables with a user format assigned (uses SAS)

                     Usage: userfmts_win adv
                     userfmts_win adv acct
                     userfmts_win    # all datasets are listed

uslsps             - Calculate and display linesize and pagesize values for different
                     layouts based on US Letter paper and margins.

                     Usage: uslsps -l 1.0 -r 1.0 -t 1.0 -b 1.0

usps               - For paged adhoc reports that are not part of the reporting
                     system, create a US Letter postscript file (and optionally print
                     it).

                     Usage: usps file.lst > file.ps
                     usps file1.lst file2.lis subdir/file3.lst > file.ps
                     usps -p john file.lst
                     usps -p mika file1.lst file2.lst
                     usps -t 0.75 -p john file.lst
                     usps -b 0.5 -s 2 -e 3 -p john file.lst

usps2pdf           - To convert a US Letter postscript file to a pdf

                     Usage: usps2pdf file.ps file.pdf
                     usps2pdf file.ps
                     usps2pdf -u file.ps   # creates uncompressed pdf

vop (view o/p)     - To view output with the supplied table/appendix reference

                     Usage: vop 13.7.2.1
 

vtitles            - Production script to make sure .titles members have a correctly
                     matching program name inside.

                     Usage: vtitles

whosgot            - To list users who have locks on files

                     Usage: whosgot demog.sas7bdat
                     whosgot *.sas*

wt                 - To find which .titles member has a reference number

                     Usage: wt 13.2.3.4