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

Hallo community, I am writing to you because I have this problem.
I want to make the Cartesian product of two datasets where each contains 6 lines (the final db must have 36 lines) through a datastep (and not proc sql). Could you give me a hand?

The two datasets are as follows

data scoperto_1;
input Scoperto $;
datalines;
0.1
0.2
0.3
0.5
1.0
2.0
;
run;

data limite_1;
input limite $;
datalines;
40
50
60
70
80
90
;

run;

 

I want to get a single dataset with all combinations of "limite" and "scoperto" (36 rows) through a datastep (and NOT proc sql).

Thanks in advance

max

 

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

Your favorite internet search engine finds answers quickly. Here's one:

https://sasnrd.com/sas-cartesian-product-proc-sql-data-step/

--
Paige Miller

View solution in original post

2 REPLIES 2
PaigeMiller
Diamond | Level 26

Your favorite internet search engine finds answers quickly. Here's one:

https://sasnrd.com/sas-cartesian-product-proc-sql-data-step/

--
Paige Miller
max_ros
Obsidian | Level 7
Thank you very much it works wonders

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!

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
  • 465 views
  • 1 like
  • 2 in conversation