@Reeza , Here is an example: Proc HTTP
URL = &QAUrl.
Method = "get"
Out = Resp;
Run; * Assign Libname for parsing ; Libname in json "&WorkDir./Test.txt"; In an ideal world, if everything goes well, the above would work fine and I would parse the data into a dataset using something like the following: Data TestDetrails;
set in.root;
Run; However, when something goes wrong, the error occurs when I try to assign a libname. So, I don't know what is the logical condition to test for here ? For e.g. I don't have a way of figuring out if a 400 code got returned in response to my incorrect api call or if my Test.txt file is empty. I hope that adds a little more color. I definitely follow and understand how I could use a logical test for error handling, here is an example, but I don't know what an appropriate logical test would be when you can have different errors rather than a definitive logical condition like a dataset existence ? %checkds(Work.ErrorLog); *Check if Data set exists;
%If &ExistTest = 1 %Then
%Do;
%Let OutputFilePath = &OutputFilePath&FileSeperator&MyDate&SpaceSeperator&MyTime&MyFile;
%Put &OutputFilePath;
Proc Export Data = Work.errorlog
Outfile = "&OutputFilePath."
Dbms = csv
Replace;
Run;
%End;
Data _null_;
Stop;
Run;
... View more