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.

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