Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Having multiple varlists using syntax command

    Hello all,
    I was wondering how I can have multiple varlists using syntax command. As an example for two varlists, I'm trying to generate differences between the first variable of varlist1 and the first variable of varlist2, then between second variable of varlist1 and second variable of varlist2, and so on. I am not sure how to introduce two varlists using syntax command.
    Any ideas on how to do this would be highly appreciated!

    Thanks,
    Noori

  • #2
    A simple solution is

    Code:
    syntax , VARLIST1(varlist) VARLIST2(varlist)
    code referring to `varlist1'
    code referring to `varlist2'
    which can be called as

    Code:
    cmdname , varlist(first_varlist) varlist(second_varlist)
    omitting the numbers.

    If you want something "nicer", you will have to use low-level parsing commands, such as gettoken.

    Best
    Daniel

    Comment


    • #3
      Thank you very much Daniel, I appreciate your prompt response.
      Noori

      Comment

      Working...
      X