title: Using env variables to set other variables in Jenkins pipeline as code
body: <p>I cannot use environment variables set in previous blocks in access stage below.</p>
  
  <pre><code>pipeline{
  agent any
  stages{
  
        stage("set env variable"){
  
        steps{
             script{
               env.city = "Houston"
               }
            }
         } 
       }
       stage("access"){
       steps{
             sh """
                set brf = ${env.city}
                echo $brf
  
                """
  
           }
  
       }
  
  
  
    } 
    }
  </code></pre>
  
  <blockquote>
    <p>ERROR: groovy.lang.MissingPropertyException: No such property: brf for class: groovy.lang.Binding</p>
  </blockquote>
  
  <p>What is an easier way to use jenkins declarative pipeline env variables ?</p>