[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sas-l
Subject:    Re: Whine and request off topic batch
From:       Alan Churchill <savian.net () GMAIL ! COM>
Date:       2020-01-31 23:37:17
Message-ID: 088301d5d88f$604698e0$20d3caa0$ () gmail ! com
[Download RAW message or body]

Sorry Joe. Didn't see this until after I pressed send. Same comment.

Thanks,
Alan Churchill
Savian

-----Original Message-----
From: SAS(r) Discussion <SAS-L@LISTSERV.UGA.EDU> On Behalf Of Joe Matise
Sent: Friday, January 31, 2020 4:13 PM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Re: Whine and request off topic batch

Instead of DOS, use Powershell for this sort of thing. Much more powerful. 

Joe

> On Jan 31, 2020, at 5:07 PM, Martin, Vincent (STATCAN) <vincent.martin@canada.ca> \
> wrote: 
> Ignorance+stack exchange suggests
> 
> set /a "mnprev=12"
> echo in Jan3 mncur mnprev %mncur% %mnprev% >> d:\cklog.log
> 
> set /a "yrprev=%yrcur%-1"
> echo in Jan yrprev cur %yrprev% %yrcur% >> d:\cklog.log
> 
> HTH
> Vincent Martin
> 
> Senior Methodologist – Social Statistics Methods Division, Analytical 
> Studies, Methodology and Statistical Infrastructure Field Statistics 
> Canada / Government of Canada vincent.martin@canada.ca / Tel: 
> 613-853-7135
> 
> Méthodologiste principal — Division des méthodes de la statistique 
> sociale, Secteur des études analytiques, de la méthodologie et de 
> l'infrastructure statistique Statistique Canada / Gouvernement du 
> Canada vincent.martin@canada.ca / Tél. : 613-853-7135
> 
> 
> -----Original Message-----
> From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of 
> Sharon Hurley
> Sent: January-31-20 5:48 PM
> To: SAS-L@LISTSERV.UGA.EDU
> Subject: Whine and request off topic batch
> 
> Hi,
> 
> Whine - I knew DOS would never leave. Why can't I just do it in SAS?
> 
> I am writing a batch file where the month comes in as 01 and the year is 2020.
> 
> All I want to do is set the month to 12 and subtract one from the year.  It is \
> driving me crazy and it is Friday afternoon.  Here is one of my many derivations: 
> if "%mncur%" == "01" (
> 
> set /a mnprev=12
> echo in Jan3 mncur mnprev %mncur% %mnprev% >> d:\cklog.log
> 
> set /a yrprev=%yrcur%-1
> echo in Jan yrprev cur %yrprev% %yrcur% >> d:\cklog.log
> 
> goto endJAN
> )
> 
> All I get is:
> 
> in Jan3 mncur mnprev 01
> in Jan yrprev cur  2020
> 
> 
> Request - Let me know what you think!  Hope the spell check marks go away ...
> 
> Sharon


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic