BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi,

We receive a file from external source system. We read the external file (ebcdic) with a layout and create SAS datasets.
Some times, the file layout is getting changed by the source system which was not trapped by the SAS program. Our SAS program ran fine (with invalid data errors in the log file). Later we came to know about the layout change and when we printed few impacted variables, they were populated with junk values.

Can anyone suggest me a best way to identify if there are junk values in the input file? Again we cannot check each and every variable for valid numeric or character as there are 1000s of variables in the input file.

I cannot afford to abend the program if _ERROR_=1 also.

Any help is well appreciated
2 REPLIES 2
Robert_Bardos
Fluorite | Level 6
Does _error_=1 happen in the data step reading the EBCDIC input file?
If yes, you might redirect erroneous records to an "alert" type of file and react to the file's mere existence any way you want.

Somewhat like:
[pre]
filename alert "file_xyz_alert_&sysdate..txt" ;
data ... ;
...
if _error_=1 then do ;
file alert ;
put _infile_ ;
_error_ = 0 ;
end ,
....
run ;
[/pre]

Be aware however that this method may trap other errors as well.

Robert
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
You can use any one of the CHARACTER type call functions to check your SAS variable values, as needed. And based on the variable test results, optionally take action, such as sending an EMAIL with a summary report or some type of evidence revealed.

Scott Barry
SBBWorks, Inc.

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
  • 2 replies
  • 1211 views
  • 0 likes
  • 3 in conversation