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

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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