BookmarkSubscribeRSS Feed
Barb_RK_Smith
Calcite | Level 5

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

5 REPLIES 5
jwillis
Quartz | Level 8

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

jwillis
Quartz | Level 8

"claim_id ln_num" be "claim_num ln_num"

jakarman
Barite | Level 11

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 --<-----
jwillis
Quartz | Level 8

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


jwillis
Quartz | Level 8

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

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 1057 views
  • 0 likes
  • 3 in conversation