BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
art297
Opal | Level 21

The reason I suggested doing a proc summary before you used proc transpose was, from your original description, I understood that you expected to have multiple records for each of your class variables.  The purpose of using proc summary was to combine those records, by summing the values, prior to transposing the file.

bbb_NG
Fluorite | Level 6

Art,

Thank your for your remind.

I have suffered the following phases.

1.Broken data in several data-views in the database.

2.Consolidated records (with PK) merged with information needed say, adding Gender/Profit,etc.

3.Using Proc SQL for generating data set by grouping classes + CMP+ Value for CMP

4.Union all those from phase 3, generating a vertical duplicated data.

5.Exporting to txt file.

6.Using Excel Pivot table wizard, all grouped fields in Page level, 'CMP' in Row level, Value for cmp in Data using sum function.

from step 1-6, I achieved my purpose as supporting role.

and after setp 4, the records number reaches 4M. and I want to do some enhancement for efficiency sake.

and I don't want to start from setp 1 again to generate a data with grouped value but not vertical showing ,but with horizatal showing, which means a lot of coding again.

thus I tried to just begin after step 4 to use transpose to get my desired format.

as to how to treat them to be readable in Excel pivot , I 'm not having a whole solution.

art297
Opal | Level 21

My opinion?  Too many seemingly disjointed steps.

I would much rather have one stream of code that can be verified.  Sometimes, starting over is the best way to solve a problem.

bbb_NG
Fluorite | Level 6

Art,

     Thanks for your opinion.

     To have a good start and a good construction of the whole project is very important, which i can not agree more.

     I was graduated from computer science.I was training to group code for differenct purpose into moudles.

     The advantange is obvious,  if I can not write code without error, this method will be easy when conduct debug.

     And from you I learned to conduct a good framework before starting is important.

     Thanks for sharing your thoughts.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 18 replies
  • 1519 views
  • 6 likes
  • 4 in conversation