ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » General Discussion » VBScript put to queue : speed bump

Post new topic  Reply to topic
 VBScript put to queue : speed bump « View previous topic :: View next topic » 
Author Message
shogan2003
PostPosted: Wed Jun 23, 2004 12:21 am    Post subject: VBScript put to queue : speed bump Reply with quote

Centurion

Joined: 03 Jul 2003
Posts: 133
Location: London

I am using VBScript to put a message to a queue.
The script is called by cscript.exe; it is not embedded in a web page.

The script opens a text file, reads its contents into variable msg_str and writes them to a queue.

Here's an extract.

'##### OLD WRITE STATEMENT ########################'
'msgPut.MessageData = msg_str
'

The weakness is that some values, e.g. £, are changed

So instead I coded a loop based around WriteUnsignedByte. See below.

' SOLUTION : START'
for indx = 1 to Len(msg_str)
msgPut.WriteUnsignedByte(ASC(Mid(msg_str, indx, 1)))
next
'SOLUTION : END'.

The trouble is that although the character values are preserved, the time taken to put the whole contents to file is drastically slower.

On the machine I'm using, which is a good spec, tests indicate a transfer rate of 1 Mb / 40 sec irrespective of file size, so 32Meg file takes 22 min to put to queue. With the original (flawed) put, a 100Mb file would be put in under 2 mins.

Do any of the other write methods offer speed *and* data preservation ?

I'm assuming that the loop is responsible for the deterioration in speed, so am seeking a method along the lines of

WriteUnsignedBytes ( String or array, int start, int length )

Write methods available for msgPut ( object type MQAX200.MQMessage) are given below.

- Write
- WriteBoolean
- WriteByte
- WriteDecimal2
- WriteDecimal4
- WriteDouble
- WriteDouble4
- WriteFloat
- WriteInt2
- WriteInt4
- WriteLong
- WriteNullTerminatedString
- WriteShort
- WriteString
- WriteUint2
- WriteUnsignedByte
- WriteUTF

Thanks in advance
Sean
_________________
MQSI2 certified specialist
MQSeries certified specialist
Back to top
View user's profile Send private message Send e-mail
jefflowrey
PostPosted: Wed Jun 23, 2004 3:04 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

If you want to read in a block of data, and put it into a message unchanged, then read it as a block of bytes and use Write.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
JasonE
PostPosted: Wed Jun 23, 2004 6:55 am    Post subject: Reply with quote

Grand Master

Joined: 03 Nov 2003
Posts: 1220
Location: Hursley

In your string example, the conversion happens because VB is unicode, and it converts it to the ccsid, so if you put the characterSet to be unicode (1200?), no conversion will occur
Back to top
View user's profile Send private message
shogan2003
PostPosted: Wed Jun 23, 2004 10:25 am    Post subject: Reply with quote

Centurion

Joined: 03 Jul 2003
Posts: 133
Location: London

Thank you both very much indeed.

I've assigned CharacterSet value of 1200. Case closed.
_________________
MQSI2 certified specialist
MQSeries certified specialist
Back to top
View user's profile Send private message Send e-mail
shogan2003
PostPosted: Wed Jun 23, 2004 11:58 pm    Post subject: Reply with quote

Centurion

Joined: 03 Jul 2003
Posts: 133
Location: London

Sorry, I mean 1208. UTF-8
_________________
MQSI2 certified specialist
MQSeries certified specialist
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General Discussion » VBScript put to queue : speed bump
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.