BookmarkSubscribeRSS Feed
deleted_user
Not applicable
hello ,

i have two data sets which i need to concatenate and i'm getting errors when i run the Merge for both.The variables for the two datas ( period 2A and period 2B ) are :

Period 2A
TransactionID $1-8
TimeofSale $9-16;

Period 2B
TransactionID $1-8
DateofSale $9-18
LaptopModel $19-24
UnitsSold 25-27
Warranty 28;

I have sorted the two datas by the Transaction ID and then run the following merge :


data new;
merge period2A period 2B;
by TransactionID;
proc print data = new;
TITLE "Period2 Sales";
Run;

I get the LOG error as :

3 data new;
24 merge period2A period 2B;
-
22
200
ERROR: File WORK.PERIOD.DATA does not exist.
ERROR: File WORK.B.DATA does not exist.
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, (, -, :, ;, END,
_DATA_, _LAST_, _NULL_.

ERROR 200-322: The symbol is not recognized and will be ignored.

25 by TransactionID;

NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.NEW may be incomplete. When this step was stopped there were 0
observations and 5 variables.
NOTE: DATA statement used (Total process time):
real time 0.01 seconds
cpu time 0.00 seconds



26 proc print data = new;
27 TITLE "Period2 Sales";
28 Run;

NOTE: No observations in data set WORK.NEW.
NOTE: PROCEDURE PRINT used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
4 REPLIES 4
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Honestly, you really need to desk-check your program and your code with your SAS log output thoroughly before posting.

Also, there was another post/reply with the exact answer to the problem revealed in this post.

http://support.sas.com/forums/thread.jspa?threadID=8721

Scott Barry
SBBWorks, Inc.
Flip
Fluorite | Level 6
I get the feeling we are being used as tutors in a basic SAS class.
DanielSantos
Barite | Level 11
Same here, which is kind of boring to me.

Cheers from Portugal.

Daniel Santos @ www.cgd.pt
Doc_Duke
Rhodochrosite | Level 12
Mark,

You have been found out. I should have jumped in when I saw "SAScourse" as a part of a directory name. I teach the SAS part of an Intro Biostat course.

Your questions are consistent with a person who is "scanning for an answer" rather than "reading for understanding." The reference manual is a hard place to get "understanding" unless you already have a couple of computer languages under your belt (They are necessary for the specific syntax, but are harder for the big picture.). The SAS "concepts" manuals are better, but still assume a certain level of sophistication with computer languages and "structured programming" ideas. You need to be carefully reading your course materials and perhaps supplementing it with one of the good introductory SAS books in the "Books by Users" series. If your course has an instructor, you should also be using him or her.

The forum is helpful to new users, but we appreciate ones who do some of their own thinking too.

Doc Muhlbaier
Duke

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