4 Replies Latest reply: Aug 31, 2016 3:49 PM by Kristina Stephenson RSS

    IF/END IF within LOAD?

    Kristina Stephenson

      Hi All,


      Is similar logic to use within a LOAD statement? There are a few variables that I only want to load in the data set if my $(vSource) variable resolves to a specific source. Otherwise, I don't want the variables to be pulled in the dataset. IF/END IF doesn't appear to work within the LOAD statement.




        • Re: IF/END IF within LOAD?
          Sunny Talwar

          Can you share what you have tried thus far? Or may be try this:


          IF $(vSource) = 'Path.....' then


               LOAD *

               FROM $(vSource);



            • Re: IF/END IF within LOAD?
              Kristina Stephenson

              I was hoping to use the IF THEN logic(or something similar) within the LOAD... I don't do a LOAD * because I'm only pulling in a subset of variables and also using TEXT(), APPLYMAP() etc. There are a few fields (in the example var11-var13) that are only available for a certain source that I would like to include if run for that source...



                   LOAD var1,

                             TEXT(var2) AS var2,





                            IF $(vSource) = 'Source' THEN




                            END IF

                   FROM $(vSource);


              END IF;