/* search FDR database */
/* signal on error */
signal on syntax
trace o
cgi = 'PHOTO'; vers = '1.2'; errto = 'STMK@VM.MARIST.EDU'
e1 = time('R')
cmdstat1 = fdrstats() /* vtime ttime reads writes sios */
'REXX FDRHTTP' cgi vers
text = getvar('TEXT')
type = getvar('TYPE')
db = getvar('DB')
text = fdresc(text)
CELLFORM = 'LID;15-DATE;17-JUNK;2-TITLE;1024-',
'FILEID;50'
'OUTPUT
Your Search Results
'
'OUTPUT '
'OUTPUT ' ,
'Library ID | ' ,
'Date | ' ,
'Title | ' ,
'Photo | ' ,
'
'
if (type == "title") then do
text = translate(text)
srch = "UCTITLE like '%"text"%' order by lid"
end /* title */
else
srch = "(DT1 like '%"text"%') order by dt1"
/* Handle the different eras */
select
when (db == "1") then
ndb="DEPRESSV"
when (db == "2") then
ndb="WWIIV"
when (db == "3") then
ndb="FDRV"
otherwise
ndb="DEPRESSV"
end
sel ="SELECT lid, dt1, title, number" ,
"from FDR."NDB" where" ,
srch
'OUTPUT' ''
"CALLPIPE (name photo03 end ?) sql noind release" sel ,
"| > SQL DATA W"
"CALLPIPE literal" CELLFORM"%&%PHOTO | > STEM DATA W"
"CALLPIPE (name photo03 end ?) sql noind release" sel ,
"| c: count lines" ,
"| rexx stempros "CELLFORM"%&%PHOTO" ,
"| change /\// |*: " ,
"?" ,
"c: | var num"
If rc <> 0 then signal sqlerr
'OUTPUT
' num ' matches returned.'
/*%include fdrsuff */
/* suffix */
e2 = time('R')
'REXX FDRCLEAN' cmdstat1 e1 e2
'OUTPUT