BookmarkSubscribeRSS Feed
mauri0623
Quartz | Level 8

I have 4 SAS log files that produce the followings,

 

Log 1 produces,

rc = 0 after rm of enrollfee_notif0102.sas7bdat
rc = 0 after rm of mailing_notif0102.sas7bdat
rc = 0 after rm of pnt_notif0102.sas7bdat
Successful run of TMARPT_NOTIF01.sas at Thu Feb 28 02:10:02 EST 2019 RC=0

 

Log 2 produces,

rc = 0 after rm of notif02_file
rc = 0 after rm of enrollfee_notif0102.sas7bdat
rc = 0 after rm of mailing_notif0102.sas7bdat
rc = 0 after rm of pnt_notif0102.sas7bdat
Successful run of TMARPT_NOTIF02.sas at Thu Feb 28 02:15:02 EST 2019 RC=0

log3 produces,

Successful run of TMARPT_NOTIF05.sas at Thu Feb 21 02:40:02 EST 2019 RC=0
chmod: cannot access `/saswork/output/tma/report_output/NOTIF05-????-20190220.PIP': No such file or directory
NOTIF05 Report Terminated at Thu Feb 21 02:40:02 EST 2019
Trying to chmod 775 /saswork/output/tma/report_output/NOTIF05-????-20190220.PIP
Return Code: 1

log4 produces, 

Successful run of TMARPT_NOTIF06.sas at Thu Feb 21 02:45:02 EST 2019 RC=0
switching directory to /saswork/output/tma/pnt/archive
making directory p20190220
chmod 755 p20190220
moving /saswork/output/tma/pnt/archive/PNT.* to /saswork/output/tma/pnt/archive/p20190220
mv: cannot stat `/saswork/output/tma/pnt/archive/PNT.*': No such file or directory
chmod: cannot access `/saswork/output/tma/report_output/NOTIF06-????-20190220.PDF': No such file or directory
NOTIF06 Report Terminated at Thu Feb 21 02:45:02 EST 2019
Trying to chmod 775 /saswork/output/tma/report_output/NOTIF06-????-20190220.PDF
Return Code: 1

I need to read these log files into SAS and produce a .txt file from them. How can I accomplish this task.

2 REPLIES 2
Patrick
Opal | Level 21

Do you need to parse any of the text or do you just need to create a new text file by concatenating the 3 log files?

andreas_lds
Jade | Level 19

Textfiles are read with a data-step using infile and input statements. See the documentation of both statements for examples. The infile-statement allows wildcards, so you can read all files with one step. If you want to create a text-file you use file and put statements.

 

I can't give you code, because you forgot to explain how the output should look.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 2 replies
  • 942 views
  • 0 likes
  • 3 in conversation