title: Stack implementation in CL program (OS400/iSeries)
body: <p>i am starting programming using CL on IBM system i. My task is to implement RPN calculator using CL language. Typically, this calculator uses stack. But I have no idea have to implement it in CL. Can someone give me some advice? Maybe *PTR variables are solution, but can someone give me an example how to use it?</p>
  
  <p>Thanks in advance
  JS</p>
  
  <p><strong>edit:</strong></p>
  
  <p>CL language is imposed by my tutor. </p>
  
  <p>My program should receives signs from user (digits/number, signs of mathematical operations).<br>
  After receiving each sign program should analize what was received and then take some action, according to pseudo-code:</p>
  
  <pre><code>Do when new sign was entered:
  if: entered sign is a number
      then push it into stack
  else if: entered sign is a sign of mathematical operation 
      then 
      - pop two elements from stack 
      - make operation using this elements and entered sign 
      - push result into stack
  </code></pre>
  
  <p>My problem is how to implement or substitude this stack. A need to reach element in LIFO order and I do not know how many elements the structure finally will contain.</p>