BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Nasser_DRMCP
Lapis Lazuli | Level 10
data have;
infile datalines delimiter=",";
input NUM_PTR_NIV_0 NUM_PTR_NIV_1 NUM_PTR_NIV_2 NUM_PTR_NIV_3 ;
datalines ;
08000000080,08000000190,08000000080,08000011800
08000000080,08000000190,08000000080,08000905580
08000000087,08000000190,08000000080,08000011320
08000000087,08000000190,08000000080,08000011150
08000000080,08000000190,08000000080,08000010840
08000000081,08000001190,08000000180,08000905580
08000000082,08000002190,08000000280,08000011320
08000000083,08000003190,08000000380,08000011150
08000000084,08000004190,08000000480,08000010840
run ; 



data want;
infile datalines delimiter=",";
input NUM_PTR ;
datalines ;
8000000080
8000000087
8000000081
8000000082
8000000083
8000000084
8000000190
8000001190
8000002190
8000003190
8000004190
8000000180
8000000280
8000000380
8000000480
8000011800
8000905580
8000011320
8000011150
8000010840
run ; 

hello,

i have many partners number in different level;

i would like to get a list of all partners in a column

many thanks for your help

kind regards

Nasser

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26
data want;
    set have;
    array x num_ptr_niv:;
    do i=1 to dim(x);
        num_ptr=x(i);
        output;
    end;
    drop i num_ptr_niv:;
run;
--
Paige Miller

View solution in original post

2 REPLIES 2
PaigeMiller
Diamond | Level 26
data want;
    set have;
    array x num_ptr_niv:;
    do i=1 to dim(x);
        num_ptr=x(i);
        output;
    end;
    drop i num_ptr_niv:;
run;
--
Paige Miller
ballardw
Super User

Or consider how you read the raw data:

 

data have;
infile datalines delimiter=",";
input NUM_PTR @@ ;
datalines ;
08000000080,08000000190,08000000080,08000011800
08000000080,08000000190,08000000080,08000905580
08000000087,08000000190,08000000080,08000011320
08000000087,08000000190,08000000080,08000011150
08000000080,08000000190,08000000080,08000010840
08000000081,08000001190,08000000180,08000905580
08000000082,08000002190,08000000280,08000011320
08000000083,08000003190,08000000380,08000011150
08000000084,08000004190,08000000480,08000010840
; 

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 547 views
  • 0 likes
  • 3 in conversation