Recent posts

#91
Nomads / Re: Library Query
Last post by Mike Hatfield - May 27, 2024, 08:59:37 PM
Hi Jane, I have already tried what you suggested. Please see attached screenshots of the dictionary definition and query definition.
My WindX session was on FID(0)="T001" in the Dictionary maintenance.
Notice that file ending in T0014, FID(0) is "T001", has been created. The number 4 being, I presume, the content of TCB(13).

This code creates the work file in the main program:
I am in WindX session where FID(0)="T003"
01031  KEYED "WKFL"+FID(0)+STR(TCB(13)),[1:1:2],[2:1:8],[3:1:8],[4:1:3],0,79
01040  OPEN (FILECHAN)"WKFL"+FID(0)+STR(TCB(13))
TCB(13) AT THIS POINT IS 0

See screenshot - query running.
Notice the WKFL" file is defined for "T003 - Correct, but the TCB(13) is 6.
I presume the TCB value is associated with the call level in the stack.

Doesn't matter how I name/define the workfile, by the time the Query wants to read it the name is different because of a random TCB(13) number.
There must be a way to do this. I don't want hundreds of temporary workfiles cluttering up the disk.
#92
Programming / Re: Copy Data Definitions
Last post by Jane Raymond - May 27, 2024, 03:28:00 PM
I wouldn't recommend that approach as there is special logic for assigning the external keys for the ddf file.
#93
Programming / Re: Copy Data Definitions
Last post by Tom Anderson - May 27, 2024, 01:45:23 PM
Jane,

That's not a bad idea. The problem is that I would need to change the file open logic in 200 - 300 programs.

Would it be feasible to read 'providex.ddf' and 'providex.dde', modify the records containing 'C1' and create a new record for 'C2'?

Thanks!

Tom
#94
Programming / Re: Copy Data Definitions
Last post by Jane Raymond - May 27, 2024, 08:32:44 AM
In the data dictionary, could you change the physical file from 'C1ARCUST' to an expression like "C"+%COMPANY$+"ARCUST"? Then if you set %COMPANY$ to "1" or "2" or whatever you can use the same data dictionary definition for both files.
#95
Nomads / Re: Library Query
Last post by Jane Raymond - May 27, 2024, 08:18:40 AM
There are two possibilities:

       
  • In the Data Dictionary, use the expression GLWK+FID(0)+TCB(13) as your physical file name. Then, whenever a new  file is created, be sure to embed the dictionary. When the query runs, it will evaluate the file name and open it.
  • In the query definition, use the expression as the File/Table. If the dictionary is embedded in the file the expression evaluates to, it will use it.
#96
Nomads / Library Query
Last post by Mike Hatfield - May 27, 2024, 05:12:28 AM
I want to create a Stanard Library Query where you pass it the file name to open for the query.
For example:
I want to create a query that will display a workfile that contains a set of transactions from the general ledger.
The workfile has a generated unique file name: EG GLWK+fid(0)+TCB(13)
I can create a File Dictionary table for a generic GLWK workfile.
My problem is how to tell the Query what file to read and how will it know to use the generic dictionary definition?

Thanks
#97
Web Services / Re: Posting a File to a Web Se...
Last post by HendersonS - May 25, 2024, 03:15:43 PM
Hi,
Jeff and St├ęphane, thank you for your help, I was finally able to find the solution with the help you gave me.

the line looked like this:
Content-Disposition: form-data; name="xml"; filename="xmlsing.xml"
#98
Web Services / Re: Posting a File to a Web Se...
Last post by St├ęphane Devouard - May 25, 2024, 01:07:34 PM
Henderson,

Jeff's suggestion is only an example, you need to check the documentation of the API you're trying to interact with and see what is the name of the html form field that this API expects. If filename does not work, maybe it is file_name or xml_file.
Also make sure that the data in the XML file is escaped using either cvs(..., "utf8:xml") if the data may contain utf8 encoded characters, or cvs(..., "ascii:xml") in case the data contains reserved XML chars such as < >


Jeff,

You can spare a call by using the cvs() function
base64_credentials$ = cvs(raw_credentials$, "ascii:base64")
#99
Web Services / Re: Posting a File to a Web Se...
Last post by HendersonS - May 24, 2024, 05:01:04 PM
jeff,

I tested both ways that you showed me and I still get the same "invalid file" response, I will continue trying...
#100
Web Services / Re: Posting a File to a Web Se...
Last post by Jeffrey Ferreira - May 24, 2024, 04:41:42 PM
i think the problem is this line
Content-Disposition: form-data; name="xmlsing"; filename="xmlsing.xml"

Mine looks like this
Content-Disposition: form-data; name="filename"; filename="s:\jeff\Cleary_Quote.xml"

i feel like your line should like something like this:

Content-Disposition: form-data; name="filename"; filename="xmlsing.xml"
in other words
the value that name =  points to should be the key in the next key value pair
i have to head out but i'll try to check back in again later on this.