[Robelle-l] RE: variable substitution (The cheap Solution)

Gates, Scott SGates@olbh.com
Mon, 7 Apr 2003 10:15:40 -0400


Thanks to everyone who responded to my question. 

Can't change the database.  I would if I could.  

The cheap solution involved writing the correct date to a file then using
the file

if finfo("lastrun.pdbctrl","EXISTS") then
   INPUT LASTRUN <LASTRUN.PDBCTRL        
ELSE                                     
   SETVAR LASTRUN;"19990901"             
SETVAR
STLASTRUN,STR("!LASTRUN",1,4)+"/"+STR("!LASTRUN",5,2)+"/"+STR("!LASTRUN",7,2
)
echo IF BD-ACCT-BAL > 0 AND &       > Datesub         
echo  ($STDDATE(BD-TURNOVER-DT) &  >> datesub         
echo  >= $DATE(!STLASTRUN) AND &  >> datesub          
echo $STDDATE(BD-TURNOVER-DT) <= $TODAY) >> datesub   
Suprtool
BA DBBB1,5;

GET BD-ACCT-SUMMARY

USE BDSUM.SUPRDEF
ITEM BD-TURNOVER-DT,DATE,YYMMDD
USE DATESUB
IF BD-ACCT-BAL > 0 AND &
 ($STDDATE(BD-TURNOVER-DT) &
 >= $DATE(1999/09/01) AND &
$STDDATE(BD-TURNOVER-DT) <= $TODAY)


> -----Original Message-----
> From:	Gates, Scott 
> Sent:	Friday, April 04, 2003 3:59 PM
> To:	'robelle-l@robelle.com'
> Subject:	variable substitution
> 
> I have a variable !STLASTRUN which = 1999/09/01 that I wish to use as a
> $DATE in a job so I can pull data from certain dates forward.  
> Eventually I will be updating the file that I read to get STLASTRUN.  
> 
> Anyway, I do this:
> SET VARSUB ON
> 
> BA DBBB1,5;
> 
> GET BD-ACCT-SUMMARY
> 
> USE BDSUM.SUPRDEF
> ITEM BD-TURNOVER-DT,DATE,YYMMDD
> IF $STDDATE(BD-TURNOVER-DT) >= $DATE(!STLASTRUN)
>                                     ^
> Error:  Invalid year for $date
> 
> It worked when I had 1999/09/01 hardcoded.  I've tried it with and without
> the quotes and gotten the same result.   
> 
> I'm storing the last rundate in a file, so I won't keep resending the old
> data. 
> 
> Can I make it accept the date in this way, or is there another work
> around?   
> 
> 
> 
> Scott Gates
> Programmer/Analyst 
> Information Services 
> Our Lady of Bellefonte Hospital 
> P.O. Box 789 
> Ashland, Kentucky 41105-0789  
> -----------------------------------
> Phone: (606)833-3773 
>   Fax: (606)833-3342
> -----------------------------------
> Quote: ...Computers are...stupid. Unlike human beings, computers possess
> the truly 
> profound stupidity of the inanimate. - Bruce Sterling - THE HACKER
> CRACKDOWN
> -----------------------------------
> Intranet: http://Olbh01iis/intranet/index.html
> Primary e-mail  : [mailto:sgates@olbh.com]
> Alternate e-mail : [mailto:msgates@pobox.com]
> -----------------------------------
> Our Lady of Bellefonte : http://www.olbh.com
> -----------------------------------
> Confidentiality Notice: This e-mail message, including any attachments, is
> for the sole use of the intended recipient(s) and may contain confidential
> and privileged information.  Any unauthorized review, use, disclosure or
> distribution is prohibited.  If you are not the intended recipient, please
> contact the sender by reply e-mail, fax, or phone and destroy all copies
> of the original message.
> 
>