Why did you use tab as the delimiter on the INFILE statement? Are you sure the file has tabs (or are you sure the file does NOT have tabs)?
Also are you sure the file will have line breaks? Many "response" files are sent without any line breaks.
Let's convert your posting into an actual file:
options parmcards=header ;
filename header temp;
parmcards4;
HTTP/1.1 202 Accepted
Content-Length: 0
Cache-Control: no-cache; no-store; must-revalidate; max-age=0
Content-Location: https://testapi.gov.in/api/v1/jobs/4648
Pragma: no-cache
Date: Fri, 16 Apr 2021 10:58:50 GMT
Connection: keep-alive
Strict-Transport-Security: max-age=86400
X-Content-Type-Options: nosniff
;;;;
Please show what output you expect to get from that example input. What part of that is the STATUS? The URL?
To be more robust you probably want to test what the line LOOKS like rather than its position.
Assuming the file actually has line breaks you might use something like this:
data want;
do row=1 by 1 until (eof);
infile header truncover end=eof;
input @;
if row=1 then input status $100. ;
else if _infile_=:'Content-Location:' then input @':' url $200. ;
else input;
end;
run;
Result
Obs row status url
1 9 HTTP/1.1 202 Accepted https://testapi.gov.in/api/v1/jobs/4648
It might just be easier to read the file as NAME/VALUE pairs.
data headers ;
infile header dlm=':' truncover ;
length field $100 value $200 ;
if _n_=1 then do;
field='Status'; input value $200.;
end;
else input field value $200.;
run;
Results:
Obs field value
1 Status HTTP/1.1 202 Accepted
2 Content-Length 0
3 Cache-Control no-cache; no-store; must-revalidate; max-age=0
4 Content-Location https://testapi.gov.in/api/v1/jobs/4648
5 Pragma no-cache
6 Date Fri, 16 Apr 2021 10:58:50 GMT
7 Connection keep-alive
8 Strict-Transport-Security max-age=86400
9 X-Content-Type-Options nosniff
... View more