BookmarkSubscribeRSS Feed
arpi
Fluorite | Level 6

consider three files:

 

grade.txt

67 F 97 A 91
. M 62 F 67
35 F 77 C- 77
49 M 59 C 81

 

grade2.txt

21 M 80 B- 82
. F 90 A 93
35 M 87 B+ 85

 

grade3.txt

48 F . . 76
59 F 95 A+ 97
15 M 88 . 93

 

data combined;
infile "C:\Users\sachin\Desktop\SAS\DataSet\Learning\grades?.txt" truncover;
input age 1-2
gender $ 3-4
Mark1 5-7
Grade $ 8-10
Mark2 11-13
;
run;

This can be easily done using wildcard character (?).

 

I hope this helps!!!

rvsidhu035
Quartz | Level 8
filename fn pipe 'dir h:\temp\*.txt /s /b';
What is mean /s /b here

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 16 replies
  • 11810 views
  • 5 likes
  • 8 in conversation