Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^2: Accessing flat files on the mainframe

by Fuism (Beadle)
on Sep 02, 2004 at 23:02 UTC ( [id://388157]=note: print w/replies, xml ) Need Help??


in reply to Re: Accessing flat files on the mainframe
in thread Accessing flat files on the mainframe

OK guys, heres the information. Some of the data is packed so it doesnt look like a CSV file or anything like that. Supposely some of the packed information are read vertically rather than horizontally. An example of what the file looks like :
0401... .... | ... 21 .... 4323432 ... FFFF00452342334FFFFFF23333333333233333
Here is an example of the query, its written in SAS so I changed it to SQL:
Create table FILE1 as Select column1, column2, column4, column5 From CSPAM Where TNDR_VOID_C = '0' AND OCCUR_Q > 1 Create table FILE2 as Select column1, column3, column14, column25 From ACCT Where ST = 'MN' Select a.*, b* from FILE1 a, FILE2 b where a.ID = b.ID
Thanks again for all your help guys.. Fuism

Replies are listed 'Best First'.
Re^3: Accessing flat files on the mainframe
by Old_Gray_Bear (Bishop) on Sep 02, 2004 at 23:19 UTC
    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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://388157]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2024-04-26 00:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found