Mack Altman · May 3, 2019 go to post

Yes, this would still need to be compiled. To give an example, an uncompiled AR inventory report will be around 500MB in XML format. When compiled (utilize PowerShell to open the XML with Excel, and SaveAs and XLSX formatted file), the resulting file will be around 25MB.

Mack Altman · May 1, 2019 go to post

While the XML solution will work, XML is heavy. You’ll need to have it compiled post-creation, which can be done programmatically on a Windows Server with PowerShell. Otherwise, I’d use a python script to do the compilation on a Unix server.

Mack Altman · Nov 2, 2018 go to post

It's amazing how many different ways everyone's taken to read a standard format. I thought I'd add this excerpt from the RFC 4180. So far, I haven't found a way to read a CSV line that takes into account all of the requirements of the escaped field, specifically with the LF character. To see this for yourself, create a new Excel workbook, data into a field and use Alt+Enter a few times, and then save the file as a CSV file. The line feeds are within the field data.

The ABNF grammar [2] appears as follows:
file = [header CRLF] record *(CRLF record) [CRLF]
header = name *(COMMA name)
record = field *(COMMA field)
name = field
field = (escaped / non-escaped)
escaped = DQUOTE *(TEXTDATA / COMMA / CR / LF / 2DQUOTE) DQUOTE
non-escaped = *TEXTDATA
COMMA = %x2C
CR = %x0D ;as per section 6.1 of RFC 2234 [2]

Mack Altman · Nov 2, 2018 go to post

This is great except in the instance where you don't know the descriptors. We utilize CSVTOCLASS for situations where we do.

Mack Altman · Nov 1, 2018 go to post

I attempted to use the following as the line terminator, which is in fact a CRLF. For some reason, it terminates even when only the LF occurs.

S fi.LineTerminator = $c(13,10)
Mack Altman · Nov 1, 2018 go to post

Here's the next challenge, and one that I'm encountering using the $$CSVtoList^%occLibrary... line feeds within the field data (enclosed in double quotes).

The line ends with CRLF, and within the double quote enclosed field there appears 
 followed by a Line feed. The RFC 4180 standard states this should be acceptable, but I'm reviewing how to review this now. Any thoughts?

Mack Altman · Nov 1, 2018 go to post

This works beautifully.

Are you aware of where the %occLibrary documentation may be referenced?

Mack Altman · Nov 1, 2018 go to post

I'd like to know this as well. It would definitely save me a lot of time by referencing this documentation.

Mack Altman · Nov 1, 2018 go to post

Typically, I've dealt with XML, EDI, and tab-delimited files within Cache. All CSV files were typically done in PHP. It's definitely a great exercise.

I did want to note that the above solution did not work with the following string.

CSIN-01,01/01/2002,01/15/2003,,1,1002381,ABC CORP,02/22/2018,"NET ""15""","ANYTOWN, DC",JANE DOE,"ANYTOWN, DC",06/13/2018,$13900.00 ,$101.15 ,$5.13 ,$308.00 ,$281.70 ,$0.00 ,$0.00 ,$217.00 ,JOHN DOE
Mack Altman · Nov 1, 2018 go to post

The initial post advised that it was to take into account fields enclosed in double quotes. CSV stands for comma-separated value, so I'm not sure how that would change the information.

I did add the example since it appeared someone may not understand what taking into account double quotes means.

Mack Altman · Nov 1, 2018 go to post

This doesn't take into account fields enclosed in double quotes. The goal is to remain compliant with RFC 4180.

Mack Altman · Oct 26, 2018 go to post

This does work. I think the only downside is if you were to apply this to longer numbers. For example, an invoice number with 9 digits you'd have to write "000000000". As far as readability, you'd have to count those zeroes every time. For this reason, I'd say the combination of $TRIM and $JUSTIFY would be more appropriate since you'd alleviate how to count the zeroes.

Mack Altman · Oct 26, 2018 go to post

If in an alternate namespace, this would require the namespace to contain the %qarfunc, or have a routine mapping to the USER namespace.

Mack Altman · Aug 24, 2018 go to post

It's been a while since I posted this. However, we have since upgraded to 2015.2 and we're receiving the above error when we put the correct settings in Task Manager Email Settings.

Is anyone successfully sending emails via SMTP with Office 365/Exchange Online?

Mack Altman · May 5, 2018 go to post

I came across this comment and felt that others may benefit by reviewing the documentation rather than the debate. The documented answer for this is found here.

Mack Altman · May 2, 2018 go to post

I know that mgstat has the queue size, blocks updated, and phase. What I'm looking for is more what is left in the queue.

As of now, the WD is still on the same phase (1h and 6m later).

Mack Altman · Apr 11, 2018 go to post

Answers to the following questions may be helpful.

  • What Caché version are you running?
  • What operating system is Caché running on?
  • What operating system is the shared drive?
Mack Altman · Mar 13, 2018 go to post

I did this as instructed on the referenced post, but no errors are being encountered.

Mack Altman · Sep 21, 2017 go to post

For those interested, I thought I'd share the solution we reached.

We have the Purge Task History job running each AM. We utilized this as a hook so that when this is completed it triggers the Tasks we want to run, essentially, at startup. This was done "How often do you want the Task Manager to execute this task?" to "After another task completes".

Mack Altman · Sep 21, 2017 go to post

While I would love to use %ZSTART, we use a third-party application on our DB that we want to ensure our code isn't intermingled with, or inadvertently removed when the product owner decides to change dependencies of theirs within %ZSTART. Basically, we would know for certain that changes made within %ZSTART are only from that product owner.

This is a great idea as well.

Mack Altman · Sep 20, 2017 go to post

To answer your first question, the server is restarted nightly to receive a daily backup.

Specifically, I am looking to find out if there is a way to do this within Task Manager.

Mack Altman · Aug 31, 2017 go to post

While it is possible, I would ensure that it is not possible to perform the actions within Caché first. This would enhance the application's ability to work better across platforms as well. Many of the functions that users would want to use have been compiled into classes, which you can refer to the class documentation here.

Its important to note that Caché reserves system memory for itself, so external calls would rely on the system's memory less that which has been reserved for the database. In most cases, a database is set up to run on its own system (i.e. the server is optimized to run the database only). I have been in a situation where someone did not recognize this and caused the server to lock up due to consuming the remaining memory.

As far as how to do this, it would depend on your Caché version and your Operating System, but it would be done with the $ZF function, which you can read up on here.