While reading from Mainframe.: ERROR: Bad request. Use the debug option for more info.

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 81
Accepted Solution

While reading from Mainframe.: ERROR: Bad request. Use the debug option for more info.

Hi,

I am getting the below error while reading data from GDG base into SAS. This code is running fine from many years, but errored out in execution after sas 94 migration. Could it be realted to SAS 9.4 as it executed fine in SAS 9.2 ?


  1? filename ffile ftp "'ABC.DEF(0)'" recfm=f user="XX7225A" pass="FGH458"
  2? host="xxx.com" debug lrecl=150 blocksize=0 rcmd="site unit=sysda prim=1000 sec=25 recfm=fb lrecl=150";
data num;
  3? infile ffile missover obs=1;
input @030 num $ebcdic7.;
  6? num = num + 1;
put num=;
  8? run;

NOTE: Character values have been converted to numeric
      values at the places given by: (Line)Smiley SadColumn).
      6:10
NOTE: Numeric values have been converted to character
      values at the places given by: (Line)Smiley SadColumn).
      6:17
NOTE: 220-FTPD1 IBM FTP CS V1R13 at xxx.com, 08:02:05 on
      2014-10-30.
NOTE: <<< 220-FTPD1 IBM FTP CS V1R13 at xxx.com, 08:02:05 on
      2014-10-30.
NOTE: <<< 220 Connection will close if idle for more than 5 minutes.
NOTE: >>> USER XX7225A
NOTE: <<< 331 Send password please.
NOTE: >>> PASS XXXXXX
NOTE: <<< 230 XX7225A is logged on.  Working directory is "XX7225A.".
NOTE: >>> PORT 10,16,124,11,140,17
NOTE: <<< 200 Port request OK.
NOTE: >>> TYPE I
NOTE: <<< 200 Representation type is Image
NOTE: >>> PWD
NOTE: <<< 257 "'XX7225A.'" is working directory.
NOTE: >>> site unit=sysda prim=1000 sec=25 recfm=fb lrecl=150
NOTE: <<< 200 SITE command was accepted
NOTE: >>> RETR 'ABC.DEF(0)'
NOTE: <<< 125 Sending data set ABC.DEF.G0164V00 FIXrecfm 150
NOTE: User XX7225A has connected to FTP server on Host xxx.com .
NOTE: The infile ffile is:
      Filename='ABC.DEF(0)',
      Pathname= "'XX7225A.'" is working directory,
      Local Host Name=ddss,
      Local Host IP addr=1.2.3.4,
      Service Hostname Name=xxx.com,
      Service IP addr=5.6.7.8.,
      Service Name=FTP,Service Portno=21,Lrecl=150,
      Recfm=Fixed

num=155
NOTE: <<< 451 Transfer aborted: send error.
NOTE: >>> QUIT
ERROR: Bad request. Use the debug option for more info.
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.num may be incomplete.  When this step was
         stopped there were 1 observations and 1 variables.
NOTE: DATA statement used (Total process time):
      real time           0.95 seconds
      cpu time            0.06 seconds


Accepted Solutions
Solution
‎11-06-2014 01:16 AM
Frequent Contributor
Posts: 81

Re: While reading from Mainframe.: ERROR: Bad request. Use the debug option for more info.

Hi,


The issue has been resolved with below method:

data number;

infile sdatafile missover;

input @1 stype $ebcdic2. @;

if stype='00' then do;

input @030 number $ebcdic7.;

number = number + 1;

output;

end;

run;

Getting input of variable on $ebcdic2. format and then specifying the if condiiton.

This was related to SAS 9.4 change.

Thanks,

Daman

View solution in original post


All Replies
Esteemed Advisor
Posts: 6,734

Re: While reading from Mainframe.: ERROR: Bad request. Use the debug option for more info.

Is the error completely repeatable or is it intermittent?

Is the format of the file on the mainframe still FB/150?

You may also try with a simpler filename statement; when reading FB files, we found that

host="xxx" user="xxx" pass="xxx" recfm=f lrecl=xxx

is sufficient.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Occasional Contributor
Posts: 6

Re: While reading from Mainframe.: ERROR: Bad request. Use the debug option for more info.

Since you have obs=1, and since the SASlog shows "num=155", it seems to have executed.

BTW - you are not reading a GDG base, but rather the current generation.  The base has no data.

Frequent Contributor
Posts: 81

Re: While reading from Mainframe.: ERROR: Bad request. Use the debug option for more info.

- I have tried with these options but the issue still persists !!

- that 155 is the value of the num and that is the only record gets printed as its obs=1.

Occasional Contributor
Posts: 6

Re: While reading from Mainframe.: ERROR: Bad request. Use the debug option for more info.

So my point is that the step does seem to execute, with the errors following that.

How about throwing in some other processing after the put, maybe put 'FINISHED'; or change to obs=2.

Also, maybe a second data step to see if it gets that far.

Frequent Contributor
Posts: 81

Re: While reading from Mainframe.: ERROR: Bad request. Use the debug option for more info.

- Yes the put statement with "FINISHED" gets printed in log, so it means step is getting executed !

Esteemed Advisor
Posts: 6,734

Re: While reading from Mainframe.: ERROR: Bad request. Use the debug option for more info.

Hmmm. It says "send error". Could it be that obs=1 somehow results in a client-side termination of the FTP transfer that the z/OS server does not like, causing it to emit the 451? The 451 message comes after the conclusion of the first data step iteration, as is shown by the num=155 line. What happens if you omit the obs=1 option?

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Frequent Contributor
Posts: 81

Re: While reading from Mainframe.: ERROR: Bad request. Use the debug option for more info.

- If i omit the obs=1 option then it goes to infinite loop with blank values.

Occasional Contributor
Posts: 6

Re: While reading from Mainframe.: ERROR: Bad request. Use the debug option for more info.

Did you try obs=2?

Did you try a 2nd DATA step?

How many obs in your input file?  Try obs = a value bigger than your input file size.

Granted, this does not avoid the error, but it lets you diagnose and also get processing done.

Frequent Contributor
Posts: 81

Re: While reading from Mainframe.: ERROR: Bad request. Use the debug option for more info.

Yes i tried with obs=2 and ob=10 as well, This error still stands !!

Occasional Contributor
Posts: 6

Re: While reading from Mainframe.: ERROR: Bad request. Use the debug option for more info.

I assumed it would, but did it correctly process the 2 and 10 obs?

2nd Data step?

Try to anticipate follow-up questions.

[If I wanted to pull teeth, I would have gone into dentistry.]

Frequent Contributor
Posts: 81

Re: While reading from Mainframe.: ERROR: Bad request. Use the debug option for more info.

And the main thing to note here is that, this code was running perfectly in SAS 9.2 and this issue started in SAS 9.4. SO might be related to some of the SAS 94 changes or options...What do you think?

Esteemed Advisor
Posts: 6,734

Re: While reading from Mainframe.: ERROR: Bad request. Use the debug option for more info.

Do you still have 9.2 at hand to verify that there was not a simultaneous change on the z/OS side?

If you can really pin it to 9.4, then a call to SAS TS is advised.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Solution
‎11-06-2014 01:16 AM
Frequent Contributor
Posts: 81

Re: While reading from Mainframe.: ERROR: Bad request. Use the debug option for more info.

Hi,


The issue has been resolved with below method:

data number;

infile sdatafile missover;

input @1 stype $ebcdic2. @;

if stype='00' then do;

input @030 number $ebcdic7.;

number = number + 1;

output;

end;

run;

Getting input of variable on $ebcdic2. format and then specifying the if condiiton.

This was related to SAS 9.4 change.

Thanks,

Daman

Esteemed Advisor
Posts: 6,734

Re: While reading from Mainframe.: ERROR: Bad request. Use the debug option for more info.

Thank you for the info.

It is not the first time that a new SAS version causes problems w/regard to EBCDIC and handling of mainframe data.

The $EBCDIC. format changed it's behaviour repeatedly between 8.2, 9.1 and 9.2 (handling of German umlauts).

Looks funny, though. The error seems to be caused by trying to read @30 in all records, and it behaves as if the record was too short in case that stype ne '00'.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 14 replies
  • 699 views
  • 0 likes
  • 3 in conversation