Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
WHEEEE!

If you have a SAS proc to access your data, then change the Proc Print statements to put the packed-decimal fields out in zoned-decimal (printable character) format. That solves one of your biggest issues right off the top -- If you have a MainFrame format problem, use MainFrame re-formatting tools before you grab the file. Now use your favorite FTP to get the file over from the Big Iron World into the small iron world.

Procede to read the resultant file as the normal string-of-characters that Unix expects. You will have to use substr or something simular to break up the string into records (unless you remembered to have the SAS code write the new lines for you...) and then attack each record with substr and crow-bar to get the fields pulled out of the record correctly.

Wheee what fun. (And don't even think about trying to create a MainFrame readable record on your Unix system. Send SAS a flat file and have it rebuild the pack-decimal for you.)

(Personally, I do the whole problem over on the MF using PL/1. But.)

----
I Go Back to Sleep, Now.

OGB


In reply to Re^3: Accessing flat files on the mainframe by Old_Gray_Bear
in thread Accessing flat files on the mainframe by Fuism

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (6)
As of 2024-04-23 18:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found