Baanboard.com

Go Back   Baanboard.com > Forum > Baan Quick Support: Functional & Technical > Tools Development

User login

Frontpage Sponsor

Main

Poll
How big is your Baan-DB (just Data AND Indexes)
0 - 200 GB
18%
200 - 500 GB
29%
500 - 800 GB
3%
800 - 1200 GB
8%
1200 - 1500 GB
8%
1500 - 2000 GB
12%
> 2000 GB
23%
Total votes: 77

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 8th October 2019, 15:12
Arlina Arlina is offline
Member
 
Join Date: Feb 2019
Posts: 35
Arlina is on a distinguished road
Baan: Infor LN - DB: MSSql - OS: Windows
Problem in fixed-length file fields
Baan: Baan IVc
C/S: None/Unknown

Hi All,

Let me explain the whole situation here.
We want to create a file with fixed-length file fields without any separator.
For example column parent= tccom010.pctf is of length 20. Even if it is blank it needs to occupy 20 blanks spaces in the file. We are presently using sprintf$("%*s",20,shiftl$(parent)) to achieve it. The length of each data line to put into the file is always 3140 characters in this case.
So the issue here is, the file is not getting transferred to the local machine even if it is getting created on the server. The connection is getting lost at any random point(at seq.puts or server2client or on clicking on some variable). The same script is working fine in another environment though!!!
If we use any separator than there is no fixed-length file field and data line length is significantly reduced and it's working perfectly fine.
Can anyone please help/guide me on this?
Any suggestion is highly appreciated.

Thanks & Regards,
Arlina
Reply With Quote
Sponsored Links
  #2  
Old 9th October 2019, 10:17
okneb1 okneb1 is offline
Junior Member
 
Join Date: Aug 2016
Posts: 28
okneb1 is on a distinguished road
Baan: Baan IV to LN 10.6 - DB: SQL or Oracle - OS: Win/Unix
How are you calling the function seq.puts?

Is it:
Code:
seq.puts  (var1 & var2 & var 3 & var 4 &...., long fp)
or
Code:
var line fixed
line = var1 & var2 & var 3 & var 4
seq.puts  (line, long fp)
Also, ask your admins to compare the kernel parameters between your env. and the one where the script is working.
Reply With Quote
  #3  
Old 9th October 2019, 15:54
andreas.toepper andreas.toepper is offline
Senior Member
 
Join Date: Jun 2004
Posts: 180
andreas.toepper is on a distinguished road
Baan: Baan4, LN6.1 - DB: MSSQL - OS: Linux&Windows
I did have issues with multibyte stings when using fixed length and copying fixed length parts if the multibyte strings into non multibyte strings.

I’m guessing it is something like this (in my case): a mb string had been copied into a non mb string. The string contained special chars (like German umlaut). Those special chars are coded using 4 bytes. Now in the non mb string we’ve taken 20 chars out of the string. And it happened to cut off 1, 2 or 3 bytes (of the 4 bytes of the special char) at the end of the 20 chars string. It didn’t happen often, but when it occurred, LN did crash. It’s been something like this:

string new.s(200)
domain tcnama old.s
|new.s is filled with spaces prior to this statement
new.s(5;20) = old.s

I didn’t find out exactly when or why LN crashed later, but it did occur when the 4 bytes where “cut off” in the middle. I did reprogram the code to use mb strings only and changed the new.s(x;y)-stuff. The error did not occur anymore (fingers crossed).
Reply With Quote
  #4  
Old 9th October 2019, 20:33
NPRao's Avatar
NPRao NPRao is offline
Guru
 
Join Date: Aug 2001
Location: Pacific NW, USA
Posts: 3,107
NPRao will become famous soon enough
Baan: Baan 4-5,5.2(Reger),LN-6.1,Infor LN-10.x - DB: Oracle,MS-SQL - OS: HPUX, Linux, Windows
Quote:
string new.s(200)
domain tcnama old.s
|new.s is filled with spaces prior to this statement
new.s(5;20) = old.s
Programmer's manual suggests to use the Standard Tools Functions and not direct assignments to avoid data loss and unexpected results -

Quote:
string mb.cast$() ( string_expr )
string mb.cast.to.str$() ( string_expr )
__________________
The art of perfection does not lie in doing extraordinary things but, doing ordinary things extraordinarily well. [-N. Prashanth Rao]
How To Ask Questions The Smart Way,BaaNBoard,NPRao
Reply With Quote
  #5  
Old 10th October 2019, 13:46
andreas.toepper andreas.toepper is offline
Senior Member
 
Join Date: Jun 2004
Posts: 180
andreas.toepper is on a distinguished road
Baan: Baan4, LN6.1 - DB: MSSQL - OS: Linux&Windows
Quote:
Originally Posted by NPRao View Post
Programmer's manual suggests to use the Standard Tools Functions and not direct assignments to avoid data loss and unexpected results -
That a very good hint. I've been maintaining old code (may have been migrated from BaanIV into LN some years ago). I usually avoid direct assignments when concatenating strings (it's just not my style of coding).
Reply With Quote
  #6  
Old 15th October 2019, 12:20
okneb1 okneb1 is offline
Junior Member
 
Join Date: Aug 2016
Posts: 28
okneb1 is on a distinguished road
Baan: Baan IV to LN 10.6 - DB: SQL or Oracle - OS: Win/Unix
Arlina, any update? Did you manage to solve this?
Reply With Quote
  #7  
Old 16th October 2019, 06:57
Arlina Arlina is offline
Member
 
Join Date: Feb 2019
Posts: 35
Arlina is on a distinguished road
Baan: Infor LN - DB: MSSql - OS: Windows
Still no luck

Can it be because of ulimits on the server? As smaller size files are not giving any issue.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Functions Not Supported in LNUI Arlina Tools Development 3 14th June 2019 12:23
Undocumented Functions & Variables george7a Tools Development 81 30th September 2015 12:35
File generation problem using seq.puts baancust1 Tools Development 1 11th April 2011 08:27
Problem in Fixed Assets Transaction Schedule. vktonk Finance, Invoicing and Integration 0 2nd March 2008 11:36
problem while adding fields into tables hardei Tools Administration & Installation 2 10th December 2007 23:12


All times are GMT +2. The time now is 06:03.


©2001-2018 - Baanboard.com - Baanforums.com