SAS Data Integration Studio, DataFlux Data Management Studio, SAS/ACCESS, SAS Data Loader for Hadoop and others

Use of &_Input or &_Input1 in DI User Written Code

Posts: 40

Use of &_Input or &_Input1 in DI User Written Code

I wondered if anyone could shed some light here:

I have some User Written Code in a DI Studio job which was working fine. The user written code is within a loop and I changed the ordering of some of the tranforms and incorporated more things into the loop and suddenly the User Written Code stopped working.

The original code was:

data _null_; length keepvar $2000; retain keepvar;
set &_INPUT end=e;
call symput('source'||left(put(_n_,2.)),OldColumn);
call symput('target'||left(put(_n_,2.)),NewColumn);
keepvar=catx(' ',keepvar,OldColumn);

if e then do;
call symput('keepvar',keepvar);
call symputx('numobs',&RowCount);

/* write the macro variables just set to the log - for checking during development*/
%put &keepvar;
%put &numobs;

When the code stopped working the %put &Keepvar was resulting in .

After much deliberation with my colleagues we decided to try changing the &_Input in the Data Step set statement to &_Input1 and this then worked. In the User Written Body code &_Input and &_Input1 appeared to be defined as the same thing as there is only one input data set so why did changing the code to &_Input1 work? Is it something to do with the ordering of the transforms and the loop?

Super User
Posts: 5,849

Re: Use of &_Input or &_Input1 in DI User Written Code

I haven't had any problems referring to _input. It's hard to help without seeing a SYMBOLGEN log.

Data never sleeps
Ask a Question
Discussion stats
  • 1 reply
  • 2 in conversation