Midrange News for the IBM i Community


Posted by: Chris Proctor
Programmer Analyst
Columbia Sports Company
Portland, OR
Copying a CSV file to a shared network folder?
has no ratings.
Published: 25 Nov 2015
Revised: 01 Jan 2016 - 512 days ago
Last viewed on: 27 May 2017 (1404 views) 

Using IBM i? Need to create Excel, CSV, HTML, JSON, PDF, SPOOL reports? Learn more about the fastest and least expensive tool for the job: SQL iQuery.

Copying a CSV file to a shared network folder? Published by: Chris Proctor on 25 Nov 2015 view comments(6)

Good morning and happy Friday! I have a situation where I create a CSV and email to the users, but now they have asked for YTD information and it's too large to email. They've asked me if I could write it to a shared network folder. I'm assuming this is possible. Would I use QShell to move it from the IFS folder? The process, as it stands now, performs a CPYTOIMPF to a root folder then a QShell "MV" to the QDLS folder and from there it is attached to the email and sent.

Any suggestions would be greatly appreciated.

Return to midrangenews.com home page.
Sort Ascend | Descend

COMMENTS

(Sign in to Post a Comment)
Posted by: bobcozzi
Site Admin ****
Chicagoland
Comment on: Copying a CSV file to a shared network folder?
Posted: 1 years 6 months 3 days 3 hours 27 minutes ago

If by "Shared Network folder" you mean the user dragged a link to an IFS folder onto their desktop, then yes of course you can move it to that folder.

I am not familiar with the QDLS thingy as that was a short-term work around and (I believe) is deprecated.

Posted by: DaleB
Premium member *
Reading, PA
Comment on: Copying a CSV file to a shared network folder?
Posted: 1 years 6 months 1 days 13 hours 49 minutes ago

The QDLS 'thingy' is used when you do your e-mail with SNDDST TYPE(*DOC), still alive and well. The *DOC is a document in documents and folders system, which is /QDLS.

Shared network folders can be root folders. You can CPYTOIMPF directly into the target folder. If you still want to create in the original folder, you have the option to use MOV (Move object) instead of QSH.

Question: Is this file small enough to e-mail if you compress it? After you create your CSV file, you can use QSH and run a jar command to make a ZIP from it. I can find code samples if you'd like to try this.

Posted by: Ringer
Premium member *
Comment on: Copying a CSV file to a shared network folder?
Posted: 1 years 5 months 28 days 10 hours 14 minutes ago

On the CPYTOIMPF, do you trim trailing blanks? RMVBLANK(*TRAILING). 

Or set up an IFS shared folder in Netserver that the users can access. Do via System i Navigator. 

https://www-01.ibm.com/support/knowledgecenter/ssw_ibm_i_72/rzahl/rzahlcrtfileshare.htm

Also "Access : Read Only" means use normal security. That READ ONLY part is confusing. 

Ringer 

Posted by: clbirk
Premium member *
Comment on: Copying a CSV file to a shared network folder?
Posted: 1 years 5 months 11 days 12 hours 25 minutes ago

There is another option, you can put it in a web folder, and then they can access it. By that, I mean for example, you can put it in the www folder associated with the internal web domain. For example, (while not necessary to have on zendserver, I will show the example with zendserver and php, but php itself, isn't really necessary). 

I have things that users need to access, and so I made up a very simple html page with a hyperlink to the file (you don't need an html page, as you could simply have them bookmark the link...)

You can continue to do your cpytoimpf command, but now you would put it in www/zendsrv/htdocs (or whatever that path is), and of course make sure that qhttm... user has access to it.

then the users could go to like:  http://192.168.1.xxx:10088/myfolder/myfile.csv and get the file.

 

I generate lots of web pages out of rpg and dump into the htdocs folder, etc. and of course you can even do graphs, etc.

 

chris

 

Posted by: bobcozzi
Site Admin ****
Chicagoland
Comment on: Copying a CSV file to a shared network folder?
Posted: 1 years 5 months 11 days 11 hours 36 minutes ago

Chriss, I like that idea. It doesn't help with the question much, but it does solve another issue that many people have--how to automatically get data to the end-user's PC without using FTP, Client Access, "shared folders" or whatever. I like having a dedicated web page that perhaps they have a shortcut to on their desktops.

Thanks!

Posted by: clbirk
Premium member *
Comment on: Copying a CSV file to a shared network folder?
Posted: 1 years 4 months 27 days 1 hours 50 minutes ago

I think it does answer the question, they have a file too large that they used to email and they want to write it to some sort of network folder, thinking of the htdocs folder as a "network folder"

 

Send them an email with the link of the file location, and when they click on it, they can download it.

 

But back to what they originally asked about, I am a bit confused, because the network folder could be in QNTC and you could write it directly to that folder in the ifs.  I mean, I have a network folder on a windows server, that I write files from the ibmi all day long, and it is simply a qntc situation.  Not necessary to do qshell, etc.

 

You can use cpytosmtf or cpytoimpf to do such....

 

chris