BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Shanthi123
Fluorite | Level 6

Hello,

 

can some one help me to resolve sort execution failure while am doing left join .

 

PROC SQL;
	CREATE TABLE MW_ORG_INFO1 AS
	SELECT 	 DISTINCT A.ITEMNO
			,A.ORGCD
	FROM
		 TDMH2K.MAMM_PART_CHANGE_TRACKER	A
	WHERE 	A.GNO_FACILITY_CODE='92'
		AND A.CHANGE_DATE = 
			(	
				SELECT MAX(B.CHANGE_DATE) 	
				FROM TDMH2K.MAMM_PART_CHANGE_TRACKER	B
				WHERE 	A.ITEMNO=B.ITEMNO
					AND A.GNO_FACILITY_CODE=B.GNO_FACILITY_CODE
					AND B.ORGCD NE ' '
			)
	ORDER BY ITEMNO;

QUIT; 
RUN;
PROC SORT DATA=MW_ORG_INFO1 NODUPKEY; BY ITEMNO; RUN;
/**** Added on 25 April 2024 *****/
DATA GLB_LC_ITM (RENAME=(LC_ITM_TYP =ORG_CD  ));
	SET PR01GI.GLB_LC_ITM ;
	length NODE $3.;
	length ACSD $3.;
	FAC_CD=SUBSTR(LOG_CTR_CD,3) ;
	DROP LOG_CTR_CD;
If LC_ITM_TYP IN('BPP','KIT','NJORG','OAD','SPP','WPC') then NODE='NO';
Else NODE='YES';
IF LC_ITM_TYP IN('BPP','KIT','NJORG','OAD','SPP','WPC','CMD','LWL','MTH','MWL','PWR') 
THEN ACSD='NO' ;
ELSE ACSD='YES';
RUN;
/**** Added on 25 April 2024 *****/

PROC SQL;
	CREATE TABLE MW_ORG_INFO2 AS 
	SELECT	A.*
			,B.FAC_CD
			,B.NODE
			,B.ACSD
	FROM MW_ORG_INFO1 AS A LEFT JOIN GLB_LC_ITM  AS B ON A.ORGCD=B.ORG_CD
	ORDER BY A.ITEMNO;
QUIT;
RUN;

am getting error in the last step. while doing left join.

 

dataset A is having around 75k records and dataset B has  308K records.

 

ERROR: SORT EXECUTION FAILURE.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
2 REPLIES 2
SASJedi
SAS Super FREQ

Have a look at the Troubleshooting "Sort initialization failure" and "Sort execution failure" errors in Windows and UNI... for some suggestions on how to troubleshoot and fix this problem.

 

Check out my Jedi SAS Tricks for SAS Users
Shanthi123
Fluorite | Level 6

Thank you @SASJedi 

 

 

let me go through this.

 

 

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
  • 136 views
  • 2 likes
  • 2 in conversation