DATA Step, Macro, Functions and more

Data Step issue that is killing me

Reply
N/A
Posts: 1

Data Step issue that is killing me

Hi all,

I have one of those errors that I should be easily able to figure out, but for some reason my brain just isn't working today.

Can one of you please help me find the problem with the second data step?

FYI -  I am using a format statement without setting any formats.

         The purpose of this is to put the fields in the order I want to view them within the data table.

         This is working for all of the fields that I rename except one.

Please see the attached pdf for details.

Thanks SO MUCH and TGIF!  Smiley Happy

Barb

Regular Contributor
Posts: 217

Re: Data Step issue that is killing me

Posted in reply to Barb_RK_Smith

Hi,

If I'm right, you are not pulling in claim_id into the miami_claims table.  You have select * in your connection but I do not see claim_id in your native select.

create table work.miami_claims as select * from connection to odbc

Regular Contributor
Posts: 217

Re: Data Step issue that is killing me

"claim_id ln_num" be "claim_num ln_num"

Trusted Advisor
Posts: 3,215

Re: Data Step issue that is killing me

Posted in reply to Barb_RK_Smith

I am getting a little bit confused, possible has the language processor also got confused ion the same way.

The rename of variables is done at the output (data) not at the input (set) statement.

The format off all variables is done with the naming of the output but defined at the PDV  processing.

The processing (claimadj   CLM_NUM) is done of the input dataset but the warning is coming from the to be renamed one.

---->-- ja karman --<-----
Regular Contributor
Posts: 217

Re: Data Step issue that is killing me

Posted in reply to Barb_RK_Smith

You can save yourself some typing time by letting SQL align and rename your variables.  Instead of writing

"create table work.miami_claims as select * from connection to odbc "

you can write

create table work.miami_claims as

select fromvar1        as myfirstreorderedrenamedvar,

           fromvar2        as mysecondreorderedrenamedvar,

           etc...               as etcreorderedrenamedvar

from connection to odbc


Regular Contributor
Posts: 217

Re: Data Step issue that is killing me

you could also place the code below in your sql statement to replace what you are creating in your datastep:

compress(trim(CLM_NUM)||'|'||trim(put(ln_num,4.))||'|'||put(pd_dt,mmddyy6.)||'|'730! ||trim(put(ELGBL_CHRG_AMT,20.2)),' '); as claimadj  length=200

Ask a Question
Discussion stats
  • 5 replies
  • 298 views
  • 0 likes
  • 3 in conversation