BookmarkSubscribeRSS Feed
JHE
Obsidian | Level 7 JHE
Obsidian | Level 7

%macro LOBNoCode(lobname1,lobname2);

PROC TRANSPOSE DATA=Paid_Claims_Final&lobname1 OUT=Paid_Claims_Final&lobname1TRANS (DROP=_NAME_);

ID MONTH;

BY LOB Category Code CODE_DESCRIPTION;

RUN;

%mend LOBNoCode;

%lobnocode(0100,'0100');

 

Got the error:

ERROR 22-322: Syntax error, expecting one of the following: ;, (, DATA, DELIM, DELIMITER, INDB, LABEL, LET, NAME, OUT, PREFIX,

SUFFIX.

 

Do no tknow why

7 REPLIES 7
JHE
Obsidian | Level 7 JHE
Obsidian | Level 7

table PAID_CLAIMS_FINAL0100  exisiting , no problem

 

PaigeMiller
Diamond | Level 26

@JHE wrote:

%macro LOBNoCode(lobname1,lobname2);

PROC TRANSPOSE DATA=Paid_Claims_Final&lobname1 OUT=Paid_Claims_Final&lobname1TRANS (DROP=_NAME_);

ID MONTH;

BY LOB Category Code CODE_DESCRIPTION;

RUN;

%mend LOBNoCode;

%lobnocode(0100,'0100');

 

Got the error:

ERROR 22-322: Syntax error, expecting one of the following: ;, (, DATA, DELIM, DELIMITER, INDB, LABEL, LET, NAME, OUT, PREFIX,

SUFFIX.

 

Do no tknow why


It's always helpful to show us the entire SASLOG (or the relevant parts related to this PROC) and not just the ERROR message.

 

As a guess, what happens if you use this, where &lobname1 in the OUT= is followed by a period

 

PROC TRANSPOSE DATA=Paid_Claims_Final&lobname1 OUT=Paid_Claims_Final&lobname1.TRANS (DROP=_NAME_);
--
Paige Miller
JHE
Obsidian | Level 7 JHE
Obsidian | Level 7

attached

ballardw
Super User

It is best to post code and log results into a code box using the forum {i} icon.

 

Many folks don't want to open Excel or Word documents because of security or corporate policy not allowing the download.

JHE
Obsidian | Level 7 JHE
Obsidian | Level 7

ok, will do . Thank you remind me.

Astounding
PROC Star

On your OUT= designation, SAS doesn't know what the name of the macro variable is.  Using lower/upper case isn't enough:

 

OUT=Paid_Claims_Final&lobname1TRANS

 

Instead, you have to tell SAS specifically where the name of the macro variable ends by adding a dot:

 

OUT=Paid_Claims_Final&lobname1.TRANS

JHE
Obsidian | Level 7 JHE
Obsidian | Level 7

This code works. Smiley Very HappySmiley Very Happy

 

Thank you

 

%macro LOBNoCode(lobname1,lobname2);

PROC TRANSPOSE DATA=Paid_Claims_Final&lobname1 OUT=Paid_Claims_Final&lobname1.TRANS (DROP=_NAME_);

ID MONTH;

BY LOB Category Code CODE_DESCRIPTION;

RUN;

%mend LOBNoCode;

%lobnocode(0100,'0100');

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 7 replies
  • 1028 views
  • 0 likes
  • 4 in conversation