BookmarkSubscribeRSS Feed
GulbadinNaib
Calcite | Level 5

Hi everyone, I am very new to SAS 9.4, I have done some courses online but they don't seem to help with my current urgent issue and I would appreciate the help today if someone has a moment.

I have a B1 output which is fine however the BDM_HIST outputs are appearing in different columns and not in english, other sections of this code have a similar wording but the outputs have no issues so I'm not sure why this one is giving me an issue.

 

Has anyone seen this before? I have included a picture below.

 

This is the code

 

data b1;
infile "/proj/sas/sasdata/basesas/nonrisk/OnePath/InputFiles/bdm&iy.&im..csv"
dsd dlm = ';' missover firstobs = 2 linesize = 32767;
informat AR_Party_Key $18. Open_Acc ddmmyy10. close_acc ddmmyy10. Acc_Name $50. Dealer_grp $50. Strategic_AM $3. Member_type $19. OP_NB_Seg $4. Industry_NB_Seg $10.
Region $7. OP_Salesperson $37.;
format AR_Party_Key $18. Open_Acc ddmmyy10. close_acc ddmmyy10. Acc_Name $50. Dealer_grp $50. Strategic_AM $3. Member_type $19. OP_NB_Seg $4. Industry_NB_Seg $10.
Region $7. OP_Salesperson $37.;
input AR_Party_Key :$18. Open_Acc :anydtdte. close_acc :anydtdte. Acc_Name :$50. Dealer_grp :$50. Strategic_AM :$3. Member_type :$19. OP_NB_Seg :$4. Industry_NB_Seg :$10.
Region :$7. OP_Salesperson :$37.;
file_d = mdy(&im.,1,&iy_a.);
format file_d ddmmyy10.;
informat file_d ddmmyy10.;
run;

data bdm_hist;
set rladv.bdm_hist b1;
run;

data rladv.bdm_hist (compress = yes);
set bdm_hist;
run;

2 REPLIES 2
ballardw
Super User

Your picture didn't make it.

 

You have several data sets involved. So it really isn't possible to tell what might cause your issue without good samples from each. Or possibly the Proc Contents output for both sets.

 

Your BDM_hist data set will have the columns in the order they appear in rladv.bdm_hist with any variables that may be in the B1 set at the right. If you reverse the order of the data sets on the SET statement then the order will be that of B1 with any additional variables from the other set.

 

Why is order of variables ( columns) an issue? For any output that requires a specific output you can use code to write in the order desired.

 

You have to really show examples of the output "not in English". You might have an issue with the character set for some of the data.

 

Your last data step means that you have completely replaced one of the existing data sets and the code can't be rerun to see what maybe could have happened.

data rladv.bdm_hist (compress = yes);
set bdm_hist;
run;

If the data sets are supposed to have the same variables of the same type you might consider using Proc Append instead of data step with a Set statement. It may run faster and will give some warnings about inconsistent data such as different variable names or lengths of variables.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 2 replies
  • 270 views
  • 0 likes
  • 3 in conversation