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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

UNIX to AS400

Status
Not open for further replies.

EDIUnixGeek

Programmer
Mar 21, 2005
2
US
I have a requirement to take a UNIX flat file, format it into an 80 byte length field, ftp to AS400 environment.
Any help on this? I have never reformatted data to fixed length and then had to ftp to AS400 environment.

I am mapping document to delimited, variable length format.
Thanks!
 
EDIUnixGeek,

Why? The AS/400 has a Unix compatible file system called the IFS. If you must do this just make a common delimited file (.CSV) and put in on the AS/400 IFS. Then the AS/400 has native commands (CPYFIMPF) (copy from import file) that can convert the common delimited file to native database files.

HTH,
MdnghtPgmr
 
I sent this comment to our AS400 group and they still seem unaware of this. Any help on actual command to convert a comma delimited file so I can convince them? They are asking us to do the conversion prior to sending it to the AS400 system, which I feel is too much work to program if they have a command on the AS400 that will format it into the 80-byte length they need.

Thanks so much for your help!
 
EDIUnixGeek,

Here is a link to the command documentation.


Basically, as long as the number and type of fields (in the DDS for the files on the 400) match the number and type of fields in the comma delimited file, it'll work very nicely.

We use the this all the time. We get new rates from the corp. office in the form of MS Excel worksheets. We then save the worksheet as a CSV. Then we use the above command to populate our rates file on the AS/400. Never had a problem unless we forget to delete the header row.

You kind of threw me off when you said they want an 80 byte record.!? Do you mean they want the data as one big field? We tend to refer to that as a "flat file". And why would they want that when CSV works so slick?

It might also help to know what version of OS the AS/400 is running.

HTH,
MdnghtPgmr
 
I am sorry I am confused,,,, I know people get "stuck", in the fact,, of always doing something the same way.. But a traditional file transfer,, using a CSV file is very simple., You can acutally bring numbers over as numbers,, and do not have to wory about doing any reformating. I am an AS400 person,, as most of us are.. If your AS400 support team,, don't have a clue,, what we are talking about,,, send them back to school,,, they are not worth keeping.
 
jmd0252,

I would agree completely. It sounds like EDIUnixGeek is a Unix guy who has been asked to provide some data for some 400 guys who are either too lazy or too out of touch to know anything about the IFS. We have some guys like that around here. I hear it all the time. "I'm too old to be learning new stuff." Yeah, stuff that's ten years old is NOT NEW! Don't get me started...

MdnghtPgmr
 
Thankyou for your comments to my colleagues question. One supposes you must have some schoolboys there as some of your replies were extremely childish. If you are a US citizen then you have a lack of knowledge of basic world affairs but I would not think to insult if I am being asked a question about my part of the world, it is you who should perhaps go back to achool to overcome your childish reponses to my query.

For your information the purpose of this exercise is to front end JDA EDI. JDA decided in their wisdom to have a flat file format in the crappiest way I have ever seen to front end their translator into JDA MMS which is a retail system.

I have worked with EDI for some years and never ever come across in the new millenium such a way to do things.
The flat file has one field, 80 long. The issue is that ths UNIX people on a pseries are being asked to provide a field from many fields, not comma delimited but ~ delimited with e X'FF' at the end of each record (regardless of length of field, if it gets over 80 then it goes onto the next line) and then packed with blanks until the end of the line.

It is a awfull way to proceed but we have no choice as JDA is not what I would call a ground breaking package.

As for our lack of knowledge of IFS, well we have a couple of people who use it for a relational database transfer from iseries to pseries but not one with these types of limitations and awkward data manipulations.

So my question is purely one of whether or not there is an easy way to pull in the line given the fact that it is not a field based RDF which we cap copy , delimited into via 'csv (which yes I am aware of) but a ~ delimited with end of record either one line or two lines long with a X'FF'.
 
Oh and in reply to MdnghtPgmr's response about "Yeah, stuff that's ten years old is NOT NEW! Don't get me started..."....you mentioned the AS400, how many years ago did it become the eServer iSeries???.

Before one insults, which is a pointless exercise in itself as we are all in the same boat of learning, make sure you are squeaky clean.

I am not old hat and I learn each and every day having been in World Banking, Retail, Distribution, Financials, Automotive, Manufacturing (both Discrete and Process), EDI, Warehousing. I also went through Y2K and Euro Conversion to Single European Currency and now I work in the USA again with a totally different set of protocols and systems. I have also worked in Germany and Switzerland as well as the UK.

Have a nice day and please do not insult, this forum is for people to work with people not to be condescending.
 
I have never in my life,,, seen such a post,,, since I have been in DP since 1978,, and started on an IBM 360 Mod 20, with a teletype as a console. I have never hear such whinning. The whole point of my post was that the file transfer from a flat ascII file to an AS400 PF, esp when it is in a CVS formast is NOT rocket science. If you generate the .FDF from the AS400 down, and then use it as the .FDF up,, going thru IBM client access works very slick. I bring up data each week, from an Sco Unix server, that is written to a flat file. If you are a AS400 "programmer", and you do not know how to do file transfer. My Condolences.
 
And for my part, I used the term "AS/400" because that was the term used by the original poster. I tend to follow the KISS priciple.

I have been using the "iSeries" since it came out in the early '80's. I've programmed on DOS, Windows, OS/400, DEC PDP UNIX and some really obscure stuff too (anyone know what an AlphaMicro platform is?). I've worked in banking, long distance, insurance, manufacturing, and medical industries.

As to the 80 byte record thing, well it sounds crazy to me.

It's amazing the amount of flack you can get just trying to help someone out!

MdnghtPgmr
 
I know you can do file transfer via Client Access, the box we are receiving from is a pseries Mini not a small server.
The 80 character field we need to retrieve and process is a load of bollox yes for sure, but is what I have to work with as JDA ain't going to change their system to be more logical and slick. Try 50% of their code being RPGII through an RPGIV translater!!!

My issue is, I read the book, learnt about IFS...yes, all the rest of the system is sending fixed length from the PSeries except this one I want to import for the EDI interface. We tried a regular FTP and it loses the ~ delimiter and also the FF character changes.

What I am ging to do is create a record 300 long, get the input sent as a one field record from the UNIX box in .csv format and use the retrieve to bring it into a similar file on the DB2 databse and process it my end.

One supposes the thing I was trying to achieve was finding out which of the multitude of IFS file systems to use and how to go about it. No where in the IBM manual does it tell you that as far as I can fathom.

Lets start again chaps, sorry for flying off the handle, I suppose you assumed I was trying to do something I was not and definitely not trying to pass the buck to the Unix people. Just trying to understand why Unix can't send something we can read in an easy format.
 
Try taking a look at the link I posted to the commnad. You may use the "~" character as a field seperator if you like and you have many options for the end-of-file marker as well as end-of-record marker.

I would agree that IBM's documentation of the IFS is spotty. But there IS good information out there. Try checking in at There is a guy there by the name of Scott Klements (I hope I spelled that right) who has a tutorial web site that just can't be beat.

I'll see if I can't find the link and paste it here.

HTH,
MdnghtPgmr
 
My question would be if your company has an established relationship with the Unix people. IE if you pay them money for some sort of support contract, then they are suppose to provide you what you need. Which of course is always wonderful in theory. Sounds like you are between a rock and a hard place. And like we all know,, performance is everything. If you open the file via wordpad,, what type of record length do you get?
 
Hi [COLOR=red yellow]jmd0252[/color]

In reply to your question, the UNIX people are the same group of companies just a different division.
They are already receiving EDI but do so on a UNIX box.

They are retrieving the EDI transmission and sending it to us - but I think the info that [COLOR=red yellow]MdnghtPgmr[/color] gave me answers my questions.

I am very gratefull to him...very

Ta very much for all your help chaps....it is greatly appreciated - tally ho, now I can ava go
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top