BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Fifieee1
Calcite | Level 5

i am struggling to shift  zip month and amount please helpi am struggling to shift zip month and amount please help

1 ACCEPTED SOLUTION

Accepted Solutions
SASKiwi
PROC Star

Please update your post as answered in that case.

View solution in original post

6 REPLIES 6
Reeza
Super User
I'm guessing you're expected to use Data step & PUT statements? Or have you learned ODS Objects or ODSLISTS?

There's several ways to do something like this, the most easiest and basic is data step and PUT statements.

Going into ODS objects lets you add headers, formatting and control a lot of other options but is way more work.
Reeza
Super User

And this is likely the best way to operationalize something like this...so is this homework or a real problem?
https://support.sas.com/resources/papers/proceedings16/2240-2016.pdf

 

And this is the way you would most likely do it for a basic homework assignment. FYI - change the path (home/fkhurshed/Demo1) to one that works for you to run it all and see the files and output.

 

data report;

set sashelp.class;

newfile = catt("/home/fkhurshed/Demo1/", name, ".txt");
file temp filevar=newfile;

put "This is a report for " Name;
put Name "is " age " and weighs: " Weight;
*double space;
put;
put;
put "End of Report for:" Name "," sex;
run;
Fifieee1
Calcite | Level 5
I was in a long class sorry for the late reply
I was having issues with the column width.
But i figured it out thanks for the reply
Tom
Super User Tom
Super User

Are you having trouble reading in the .DAT file?

The code in your photograph does not look correct.  Do you really have a numeric variables named FIRST and LAST?  Also is NAME supposed by numeric the way it is first used in the INPUT statement?  Or is NAME character like it is used in the second place it is used n your INPUT statement?

Fifieee1
Calcite | Level 5
Yes i took the wrong screenshot and that was the wrong one. No the file just has too many spaces and the width. But i figured it out already thank you.
SASKiwi
PROC Star

Please update your post as answered in that case.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 6 replies
  • 778 views
  • 0 likes
  • 4 in conversation