BookmarkSubscribeRSS Feed
Astounding
PROC Star

Given the results you describe (and given that you have tried to simplify the problem in order to share it) ...

 

Is it possible that the variable NAMES might contain a leading tab character, rather than a leading blank?  I could imagine it's possible that a tab character within the program editor might be treated differently than a tab character brought in with %include.

 

 

dwsmith
Obsidian | Level 7
@Astounding is there a way to strip tabs if this is the case?
Ksharp
Super User

That is really weird .

1) Try %left()


	data serno_%left(&prod_grp);
		set serials2_%left(&prod_grp);
		eqp_id = trim(ser_no) || "CAT";
	run;

2) Put prefix in when that macro variable is creating.

%do i = 1 %to &cnt;
	data _null_;
		set prod (obs = &i firstobs = &i);
		call symputx ('prod_grp1', cats('serials2_',names));
                call symputx ('prod_grp2', cats('serno_',names));
	run;
	%put "&prod_grp";
	data &prod_grp2 ;
		set &prod_grp1 ;
		eqp_id = trim(ser_no) || "CAT";
	run;
%end;

 

 

dwsmith
Obsidian | Level 7

@Ksharp

 

I tried your suggestions:

SYMBOLGEN:  Macro variable NAME resolves to 	mttt
22: LINE and COLUMN cannot be determined.
NOTE 242-205: NOSPOOL is on. Rerunning with OPTION SPOOL might allow recovery of the LINE and COLUMN
              where the error has occurred.
ERROR 22-7: Invalid option name DBCREATE_TABLE_OPTS.
SYMBOLGEN:  Macro variable NAME resolves to 	mttt
ERROR: File WORK.SERNO_.DATA does not exist.

 

 

 

 

 

Number 2:

 

SYMBOLGEN:  Macro variable PROD_GRP1 resolves to serials2_mttt
"serials2_mttt"
SYMBOLGEN:  Macro variable PROD_GRP2 resolves to serno_mttt
"serno_mttt"
SYMBOLGEN:  Macro variable PROD_GRP2 resolves to serno_mttt
SYMBOLGEN:  Macro variable PROD_GRP1 resolves to serials2_mttt
ERROR: File WORK.SERIALS2_.DATA does not exist.
ERROR: File WORK.MTTT.DATA does not exist.

 

Reeza
Super User

@dwsmith Do you have this resolved or still having issues. 

 

If you are, please post your full code and log. 

dwsmith
Obsidian | Level 7
@Reeza still have this issue.
Ksharp
Super User

Number2 looks good , It render the right value. But LOG said they don't exist there. 

Check the WORK library ,and make sure they are being there .

dwsmith
Obsidian | Level 7
@Ksharp the datasets are there and nonempty. I can run this program without the %include call 100% no issues.

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
  • 23 replies
  • 1982 views
  • 2 likes
  • 5 in conversation