Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Works in PC SAS but not on Mainframe 1

Status
Not open for further replies.

riskassure

Programmer
May 6, 2005
33
US
Hi, I have the following code that works on my PC SAS software:

filename indat FTP 'data.txt' debug
HOST = 'abc.efg.org'
USER = 'username'
PASS = 'mypassword'
RECFM = f
LRECL = 9;

data tempdata;
infile indat;
input MyVar $8.;
run;

Basically, it's reading a sequential data file, with one variable of length 8. There is also a carriage return between every two consecutive records.

It gave me about 50,000 records. When I copied the exact same code onto the mainframe (TSO) and ran it, it gave me the same number of record without any error. However, when I opened the datafile to view the data, all I saw was blank.

Does anyone know what is going on?

Thanks in advance!
Chi

~~CW~~
 
Likely to be an issue with the data format. From my dim memories of working on the mainframes, they use an EBCDIC character set rather than the ascii character set that get used on PCs etc.
You'll probably need to do some translation of the data, either through the use of a format or something else. Unfortunately I've not used FTP filenames before, and not done anythign on the mainframes in years.
If this hasn't helped you, talk to one of your mainframe experts, or SAS support.
Hopefully this will help you look int he right direction.
 
I think your input datastep should look something like this:
Code:
 data test;                                                     
 infile indat end=eof  ;                                                     
 input

     @001   ISSDT    S370FPD4.                                      
     @005   VEND     $EBCDIC2.                                      
     @007   SEQNUM   S370FPD3.                                      
     @010   CURR_CD  $EBCDIC3.                                      
     @013   DECDT    S370FPD4.                                      
;

Notorious P.I.G.
 
Thanks ChrisW75 for your hint, I figured out where my problem is. The code should look like

filename indat FTP 'data.txt' debug
HOST = 'abc.efg.org'
USER = 'username'
PASS = 'mypassword'
RECFM = f
LRECL = 9;

data tempdata;
infile indat;
input MyVar $ascii8.;
run;

Notice the format has been changed from $8 to $ascii8. It now works beautifully!

~~CW~~
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top