BookmarkSubscribeRSS Feed
Babloo
Rhodochrosite | Level 12

I'm trying to create a SAS dataset mentioned in table below. However the program which I used is not producing the desired output.  Please note that there is a space in the value of the last variable PARAM_DESC. Appreciate your help here.

 

Program:

 

Desired Output:

 

         
         
8 REPLIES 8
KachiM
Rhodochrosite | Level 12

@Babloo 

 

Missed a "&" for the last variable. 

PARAM_DESC  & $
Babloo
Rhodochrosite | Level 12
Why we need a &? Also the values which I entered in the datelines are
correct? Should I put single quotes for the values which have spaces?
KachiM
Rhodochrosite | Level 12

@Babloo 

 

Read SAS Documentation for List Input. From Docs:

 

The & (ampersand) format modifier enables you to read character values that contains one or more embedded blanks with list input and to specify a character informat. SAS reads until it encounters two consecutive blanks, the defined length of the variable, or the end of the input line, whichever comes first.

 

The single quotes surrounding the input string is not necessary (if you want).

Babloo
Rhodochrosite | Level 12
 
KachiM
Rhodochrosite | Level 12

@Babloo 

 

There may be 'TAB' character as separator. Replace it by a single space and try.

Babloo
Rhodochrosite | Level 12
There is already one space between each of the values.
KachiM
Rhodochrosite | Level 12

@Babloo 

 

You have mixed use of 'TAB' and 'Space' as delimiters.

In the first record, you have a 'TAB' character between second and third variables.(PRL*** prl_ifrs17_vlu).

Babloo
Rhodochrosite | Level 12

How to identify that I've the mixed use of  'TAB' and 'Space' as delimiters?

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 8 replies
  • 1589 views
  • 4 likes
  • 2 in conversation