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

accessing files in the IFS?

Status
Not open for further replies.

confusedlady

Programmer
Apr 26, 2001
163
US
I know very little about the IFS on the AS/400. If I wish to access a file stored there in a Cobol program, how is that accomplished? What I have are many directories containing stream files that are word docs. From a Cobol program, I need to know when a file of this type is encountered, and direct Word to open. I hope that makes sense! I am only now learning what the IFS even is! Also, what are the advantages of using CPYFRMSTMF over CPYFRMIMPF?

TIA,
Melissa

Oh, we are currently using V5R1, but upgrading to R2 soon.
 
Oh, one more thing...

If anyone knows of a book or website that really focuses on the Integrated File System, that is appreciated. I have gone through everything IBM offers online, but there's really only an intro on the subject. Not a big help.
 
Humm... No IBMers answering. Anyway, let's see if we can jump start this thread.

Are you using WebSphere, WebLogic, Tuxedo, ...?

Can you describe your software/hardware environment? Obviously there is AS/400 and Windows involved here. Right?

Dimandja
 
Dimandja,

At the risk of sounding stupid, I'm not too sure what to tell you. I'm not using any of the above mentioned. Just IBM's iSeries (version 5). I usually write the old "green screen interactive" or batch processes in Cobol. This is a new venture here (not my call).

A bunch of directories contain information written and stored as word docs. I am able to map a drive from the PC side, so that I can see these stream files on the AS/400 (IFS root system), but that's it.
 
If you want to launch Word, I'm afraid you will need to do it from the PC.

For example, if your COBOL is running in one of the 'Web' environment, you could write your COBOL application as 'middleware'.

In the 'middleware' mode, your application can run Windows tools (Word), and it can access AS/400 databases and other resources as well. I believe that is the idea behind WebSphere, for example. I haven't actually used it, but that's the gist of it.

I would approach your problem from a web enabled application standpoint. I'll stop here as I may be completely off-base already.

Dimandja
 
Hi C*lady,

What you are trying to do here is access Word files from you AS400 session. In such as case, the command that you have given here as CPYFRMSTMF basically is used to copy these files (in ASCII format) to the AS400 basic file format (database format).

If in case you want to use a Cobol Program to access such a file, you need to write a CL (Control Language) code to copy such a file into AS400 format and let the Cobol program access this file afterwards.
I hope, this helps you in some way.

Thanks,
TB.
 
Thanks T*Brave! The "powers above" are undecided now if that is the route they wish to go (IFS), but if so that is a big help. So, the CPYFRMSTMF is the correct command, then? Once the file (or files) are converted to database format, the rest is same? Thanks so much
 
Hi C*lady,

There are lots of other commands too. I have not used many of these commands which deal with ASCII format files.. but you can give the command - GO CMDCPY in your AS400 session and check them out. After getting the "Copy Commands" menu, give the number/option and press F1 to get detailed help.
I am sure some command other than CPYFRMSTMF should also be there to deal with this.

Yes. Once the file is converted, the rest should be the same as writing a simple cobol program to read its records.. although i would suggest you first give it a try..

Thanks,
TB.
 
From a Cobol program, I need to know when a file of this type is encountered, and direct Word to open

TechBrave, reading these files with COBOL defeats the purpose of storing DOCs doesn't it? I thought the original idea was to read them through Word. How will COBOL understand and render Word formatting?

Dimandja
 
Hi Dimandja,

Its not the special formatting text that Cobol can read for Word Docs but its the data that has been stored in a file having extension .doc
I didnt say Cobol can read these files.

Its just that how the data in such files can be converted to a EBCDIC format into flat files which can be used then by Cobol for processing. Conversion utilities/commands have been given in AS400 which I had mentioned above.

This is just like converting excel data into a .csv file and then reading this file using any other utility or lets say a database utility.

I hope this helps..

Thanks,
TB.
 
Melissa,

I know I come up here a bit late but I'd like to add my 2 cents in this thread.
Should I be off base or inaccurate if I'd say that you only want to access to the .doc names that reside in IFS folders and that you do not want to read their contents with COBOL but open them with Word ?

If so, you'll need the access() API to read the folders contents and e.g. a cl program to open the word document by RUNRMTCMD or STRPCCMD.

hth
Philippe --
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top