Loading ...
Sorry, an error occurred while loading the content.

Filter Question

Expand Messages
  • dromeyn
    My raw data is in PST time and I want to switch it to EST. I m trying this but it s not working at all. Keep getting this error. warning: data reference
    Message 1 of 5 , Feb 18, 2004
    • 0 Attachment
      My raw data is in PST time and I want to switch it to EST. I'm trying
      this but it's not working at all. Keep getting this error.

      warning: data reference (rec=1 field=2) is out of bounds
      warning: data reference (rec=2 field=2) is out of bounds
      warning: data reference (rec=3 field=2) is out of bounds
      warning: data reference (rec=4 field=2) is out of bounds
      .
      .
      .

      Could someone take a look and tell me what I'm not understanding?
      Thanks.


      #call $setdatefmt( "mm/dd/yy.hh:mm" )
      #set today = $todaysdate()
      #set xmax = $todaysdate()
      #set xmin = $dateadd( @today, -1 )

      #proc getdata
      command: cat yesterday.dat today.dat
      pf_fieldnames: datetime home login preview quote logoff error_code
      delim: tab
      filter: ##set DATE = $substring( @datetime, 1, 8 )
      ##set HR = $substring( @datetime, 10, 2 )
      ##set MIN = $substring( @datetime, 13, 2 )
      ##set HR = arith( @HR+3 )
      ##if @HR >= 24
      ##set HR = arith( @HR-24 )
      ##endif
      ##print @DATE.@HR:@MIN @homepage @login @preview
      @quote @logoff @error_code
      showresults: yes

      here is a sample of the data:

      02/18/04.05:13 2.00 1.48 1.15 0.13 0.82 200
      02/18/04.05:19 2.07 1.40 1.10 0.14 0.82 200
      02/18/04.05:23 2.04 1.35 1.19 0.14 0.81 200
      02/18/04.05:29 2.00 1.38 1.11 0.14 0.81 200
    • dromeyn
      Based on earlier posts I tried rewritting it like this but still getting no results. I tried using file: instead of command: but it didn t make a difference.
      Message 2 of 5 , Feb 18, 2004
      • 0 Attachment
        Based on earlier posts I tried rewritting it like this but still
        getting no results. I tried using file: instead of command: but it
        didn't make a difference.

        #proc getdata
        showresults: yes
        command: cat yesterday.dat today.dat
        filter: ##set DATE = $substring( @@1, 1, 8 )
        ##set HR = $substring( @@1, 10, 2 )
        ##set MIN = $substring( @@1, 13, 2 )
        ##set HR = arith( @@HR+3 )
        ##if @@HR >= 24
        ##set HR = arith( @@HR-24 )
        ##endif
        ##set DATETIME = @@DATE.@@HR:@@MIN
        ##print @@DATETIME @@2 @@3 @@4 @@5 @@6 @@7
        fieldnames: datetime homepage login preview quote logoff error_code


        except now I get errors like this:

        pl proc bars error 2479: No such data field (homepage)
        pl proc bars error 2479: No such data field (datetime)
        pl proc bars error 2479: Warning, locfield same as lenfield
        pl proc bars error 2479: No such data field (login)
        pl proc bars error 2479: No such data field (datetime)
        pl proc bars error 2479: Warning, locfield same as lenfield
        pl proc bars error 2479: Warning, lenfield same as a stackfield
        pl proc bars error 2479: Warning, locfield same as a stackfield
        pl proc bars error 2479: No such data field (preview)
        pl proc bars error 2479: No such data field (datetime)
        pl proc bars error 2479: Warning, locfield same as lenfield





        >
        > here is a sample of the data:
        >
        > 02/18/04.05:13 2.00 1.48 1.15 0.13 0.82 200
        > 02/18/04.05:19 2.07 1.40 1.10 0.14 0.82 200
        > 02/18/04.05:23 2.04 1.35 1.19 0.14 0.81 200
        > 02/18/04.05:29 2.00 1.38 1.11 0.14 0.81 200
      • Stephen C. Grubb
        Hi pf_fieldnames is used to assign field names to the filter result.. thus you can t reference these names within the filter itself. you should use fieldnames:
        Message 3 of 5 , Feb 19, 2004
        • 0 Attachment
          Hi

          pf_fieldnames is used to assign field names to the filter result.. thus
          you can't reference these names within the filter itself.

          you should use fieldnames: to assign field names to be used by the filter,
          and pf_fieldnames to assign field names to the filter result.

          I'll clarify this in the docs.

          Steve


          On Wed, 18 Feb 2004, dromeyn wrote:

          > My raw data is in PST time and I want to switch it to EST. I'm trying
          > this but it's not working at all. Keep getting this error.
          >
          > warning: data reference (rec=1 field=2) is out of bounds
          > warning: data reference (rec=2 field=2) is out of bounds
          > warning: data reference (rec=3 field=2) is out of bounds
          > warning: data reference (rec=4 field=2) is out of bounds
          > .
          > .
          > .
          >
          > Could someone take a look and tell me what I'm not understanding?
          > Thanks.
          >
          >
          > #call $setdatefmt( "mm/dd/yy.hh:mm" )
          > #set today = $todaysdate()
          > #set xmax = $todaysdate()
          > #set xmin = $dateadd( @today, -1 )
          >
          > #proc getdata
          > command: cat yesterday.dat today.dat
          > pf_fieldnames: datetime home login preview quote logoff error_code
          > delim: tab
          > filter: ##set DATE = $substring( @datetime, 1, 8 )
          > ##set HR = $substring( @datetime, 10, 2 )
          > ##set MIN = $substring( @datetime, 13, 2 )
          > ##set HR = arith( @HR+3 )
          > ##if @HR >= 24
          > ##set HR = arith( @HR-24 )
          > ##endif
          > ##print @DATE.@HR:@MIN @homepage @login @preview
          > @quote @logoff @error_code
          > showresults: yes
          >
          > here is a sample of the data:
          >
          > 02/18/04.05:13 2.00 1.48 1.15 0.13 0.82 200
          > 02/18/04.05:19 2.07 1.40 1.10 0.14 0.82 200
          > 02/18/04.05:23 2.04 1.35 1.19 0.14 0.81 200
          > 02/18/04.05:29 2.00 1.38 1.11 0.14 0.81 200
          >
          >
          >
          >
          > Yahoo! Groups Links
          >
          >
          >
          >
          >
          >


          Stephen C. Grubb scg@...
          Scientific Software Engineer, The Jackson Laboratory
          600 Main Street Bar Harbor, Maine 04609 USA
        • Stephen C. Grubb
          Hi again, you are just juxtaposing fieldnames and pf_fieldnames use pf_fieldnames in this code and it should work. Steve ... Stephen C. Grubb
          Message 4 of 5 , Feb 19, 2004
          • 0 Attachment
            Hi again,

            you are just juxtaposing 'fieldnames' and 'pf_fieldnames'

            use 'pf_fieldnames' in this code and it should work.


            Steve

            On Wed, 18 Feb 2004, dromeyn wrote:

            > Based on earlier posts I tried rewritting it like this but still
            > getting no results. I tried using file: instead of command: but it
            > didn't make a difference.
            >
            > #proc getdata
            > showresults: yes
            > command: cat yesterday.dat today.dat
            > filter: ##set DATE = $substring( @@1, 1, 8 )
            > ##set HR = $substring( @@1, 10, 2 )
            > ##set MIN = $substring( @@1, 13, 2 )
            > ##set HR = arith( @@HR+3 )
            > ##if @@HR >= 24
            > ##set HR = arith( @@HR-24 )
            > ##endif
            > ##set DATETIME = @@DATE.@@HR:@@MIN
            > ##print @@DATETIME @@2 @@3 @@4 @@5 @@6 @@7
            > fieldnames: datetime homepage login preview quote logoff error_code
            >
            >
            > except now I get errors like this:
            >
            > pl proc bars error 2479: No such data field (homepage)
            > pl proc bars error 2479: No such data field (datetime)
            > pl proc bars error 2479: Warning, locfield same as lenfield
            > pl proc bars error 2479: No such data field (login)
            > pl proc bars error 2479: No such data field (datetime)
            > pl proc bars error 2479: Warning, locfield same as lenfield
            > pl proc bars error 2479: Warning, lenfield same as a stackfield
            > pl proc bars error 2479: Warning, locfield same as a stackfield
            > pl proc bars error 2479: No such data field (preview)
            > pl proc bars error 2479: No such data field (datetime)
            > pl proc bars error 2479: Warning, locfield same as lenfield
            >
            >
            >
            >
            >
            > >
            > > here is a sample of the data:
            > >
            > > 02/18/04.05:13 2.00 1.48 1.15 0.13 0.82 200
            > > 02/18/04.05:19 2.07 1.40 1.10 0.14 0.82 200
            > > 02/18/04.05:23 2.04 1.35 1.19 0.14 0.81 200
            > > 02/18/04.05:29 2.00 1.38 1.11 0.14 0.81 200
            >
            >
            >
            >
            >
            > Yahoo! Groups Links
            >
            >
            >
            >
            >
            >


            Stephen C. Grubb scg@...
            Scientific Software Engineer, The Jackson Laboratory
            600 Main Street Bar Harbor, Maine 04609 USA
          • Romeyn, Derek
            Wanted to reply back with what I was able to get working in case someone else can make use of it. I never was able to get the pf_fieldnames to work, I had
            Message 5 of 5 , Feb 24, 2004
            • 0 Attachment
              Wanted to reply back with what I was able to get working in case someone else can make use of it. I never was able to get the pf_fieldnames to work, I had actually tried that in an earlier attempt. What I ended up doing was using @1 - @7 to reference the fields and this worked fine. I did find a bug in the orginal suggestion for adding 3 hours to the time for timezone adjustment. If you cross midnight, the day also needs to be modified. If had also forgotten the "$" in the arith function.

              Here's the final version that seems to work well:

              #proc getdata
              showresults: yes
              command: cat yesterday.dat today.dat
              filter: ##set DATE = $substring( @@1, 1, 8 )
              ##set HR = $substring( @@1, 10, 2 )
              ##set MIN = $substring( @@1, 13, 2 )
              ##set HR = $arith(@@HR+3)
              ##if @@HR >= 24
              ##set HR = $arith(@@HR-24)
              ##set DATE = $dateadd( @@DATE, 1 )
              ##endif
              ##set DATETIME = @@DATE.@@HR:@@MIN
              ##print @@DATETIME @@2 @@3 @@4 @@5 @@6 @@7

              sample data line:

              02/23/04.23:18 1.71 0.86 3.28 0.09 0.37 200


              -----Original Message-----
              From: Stephen C. Grubb [mailto:scg@...]
              Sent: Thursday, February 19, 2004 10:32 AM
              To: ploticus@yahoogroups.com
              Subject: Re: [ploticus] Update Re: Filter Question


              Hi again,

              you are just juxtaposing 'fieldnames' and 'pf_fieldnames'

              use 'pf_fieldnames' in this code and it should work.


              Steve

              > #proc getdata
              > showresults: yes
              > command: cat yesterday.dat today.dat
              > filter: ##set DATE = $substring( @@1, 1, 8 )
              > ##set HR = $substring( @@1, 10, 2 )
              > ##set MIN = $substring( @@1, 13, 2 )
              > ##set HR = arith( @@HR+3 )
              > ##if @@HR >= 24
              > ##set HR = arith( @@HR-24 )
              > ##endif
              > ##set DATETIME = @@DATE.@@HR:@@MIN
              > ##print @@DATETIME @@2 @@3 @@4 @@5 @@6 @@7
              > fieldnames: datetime homepage login preview quote logoff error_code
            Your message has been successfully submitted and would be delivered to recipients shortly.