Dear Dan, thank you %DECLARE TIME_STAMP `date "+%y-%m-%d %H%M%S"` worked
Just for future reference , dont forget to add single quotes while using variables e.g '$TIME_STAMP' otherwise you will get error. Thanks again ----- Original Message ----- From: Dan Feldman Sent: 04/19/12 11:58 AM To: [email protected] Subject: Re: Timestamp variable as parameter gives unexpected arguments error Hi Shin, Try %DECLARE TIME_STAMP `date "+%y-%m-%d %H%M%S"` or, alternatively, -param TIME_STAMP=`date "+%y-%m-%d %H%M%S"` when you call the script (just make sure there are no spaces around the "=" sign and "" around the format. At least that's how we are doing it, and seems to be working.. Dan F. On Thu, Apr 19, 2012 at 2:39 AM, Shin Chan <[email protected]> wrote: > Hello All > > If i give following variable from command line it does not work > > -param TIMESTAMP = 'date +%c' > > It gives error > > java.lang.RuntimeException: Encountered unexpected arguments on command > line - please check the command line > > But if i enter something like > > TIMESTAMP=`date +%Y-%m-%d` it works , but i want full date including time > (2012-04-14 11:24 etc) , how to set this. > > I want to capture time stamp at which pig script was started inside the > output of that script > > Thanks and Regards , > Thanks and Regards ,
