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 » WebSphere Message Broker (ACE) Support » How to Count number of input parameters from Cobol file

Post new topic  Reply to topic
 How to Count number of input parameters from Cobol file « View previous topic :: View next topic » 
Author Message
uniswift
PostPosted: Sat Aug 03, 2013 4:37 am    Post subject: How to Count number of input parameters from Cobol file Reply with quote

Newbie

Joined: 03 Aug 2013
Posts: 7

I have to manupulate input parametrs from cobol file. I was wandering if there is any function to count those input parameters in compute node.
Please Help

Thanks in advance
Back to top
View user's profile Send private message
kash3338
PostPosted: Sat Aug 03, 2013 5:52 am    Post subject: Re: How to Count number of input parameters from Cobol file Reply with quote

Shaman

Joined: 08 Feb 2009
Posts: 709
Location: Chennai, India

uniswift wrote:
I have to manupulate input parametrs from cobol file. I was wandering if there is any function to count those input parameters in compute node.


What do you mean be input parameters? Do you want the number of records coming in? Do you have a message set in place to read the COBOL file?
Back to top
View user's profile Send private message Send e-mail
uniswift
PostPosted: Sat Aug 03, 2013 6:08 am    Post subject: Reply with quote

Newbie

Joined: 03 Aug 2013
Posts: 7

here is the sample of Cobol input file::


01 XYZ.
03 REPLY-DATA.
05 AB-CDE-FGH.
10 Name PIC X(5).
10 Address PIC X(4).
10 ID PIC X(.
10 Contact PIC X(0.


I want the count of input parameters : Name,Address,ID,Contact i.e
Count = 4
Is there any way to do that ?
Thanks
Back to top
View user's profile Send private message
dogorsy
PostPosted: Sat Aug 03, 2013 6:28 am    Post subject: Re: How to Count number of input parameters from Cobol file Reply with quote

Knight

Joined: 13 Mar 2013
Posts: 553
Location: Home Office

uniswift wrote:
I have to manupulate input parametrs from cobol file. I was wandering if there is any function to count those input parameters in compute node.
Please Help

Thanks in advance

yes, there is. First you will have to convert your cobol copybook to a message set or a dfdl schema which you will use in your compute node. Then you can use the cardinality function to work out the number of fields.
Whoever, I do not understand why you want to do it dynamically, once you have the copybook you know exactly how many fields you have.
Back to top
View user's profile Send private message
uniswift
PostPosted: Sat Aug 03, 2013 6:44 am    Post subject: Reply with quote

Newbie

Joined: 03 Aug 2013
Posts: 7

Thank for the solution

I want to append all those parameters into one string, and put it into one text file.

so,
CARDINALITY(InputRoot.*[]), will this function give me the count as 4?
Back to top
View user's profile Send private message
dogorsy
PostPosted: Sat Aug 03, 2013 7:05 am    Post subject: Reply with quote

Knight

Joined: 13 Mar 2013
Posts: 553
Location: Home Office

uniswift wrote:
Thank for the solution

I want to append all those parameters into one string, and put it into one text file.

so,
CARDINALITY(InputRoot.*[]), will this function give me the count as 4?


No. You need to understand the tree structure. I recommend you do some investigation or go to a course to get to know about the different parsers, ESQL, etc. The questions you are asking seem to be to basic.
Back to top
View user's profile Send private message
uniswift
PostPosted: Sat Aug 03, 2013 7:34 am    Post subject: Reply with quote

Newbie

Joined: 03 Aug 2013
Posts: 7

ya, i am new to wmb
well thanks..
Back to top
View user's profile Send private message
kash3338
PostPosted: Sat Aug 03, 2013 7:40 am    Post subject: Reply with quote

Shaman

Joined: 08 Feb 2009
Posts: 709
Location: Chennai, India

uniswift wrote:
I want to append all those parameters into one string, and put it into one text file.


To do the above, you don't need to do this.

uniswift wrote:
CARDINALITY(InputRoot.*[]), will this function give me the count as 4?


It would be better if you can tell us what exactly you need to do with the COBOL input.
Back to top
View user's profile Send private message Send e-mail
dogorsy
PostPosted: Sat Aug 03, 2013 7:46 am    Post subject: Reply with quote

Knight

Joined: 13 Mar 2013
Posts: 553
Location: Home Office

uniswift wrote:
ya, i am new to wmb
well thanks..

Talk to your manager and get formal training. The forum is for when you have a problem or want to discuss something, not for being educated.
Back to top
View user's profile Send private message
uniswift
PostPosted: Sat Aug 03, 2013 9:33 am    Post subject: Reply with quote

Newbie

Joined: 03 Aug 2013
Posts: 7

kash3338 wrote:
uniswift wrote:
I want to append all those parameters into one string, and put it into one text file.


To do the above, you don't need to do this.

uniswift wrote:
CARDINALITY(InputRoot.*[]), will this function give me the count as 4?


It would be better if you can tell us what exactly you need to do with the COBOL input.




Thanks..


Consider this Sample:

01 XYZ.
03 REPLY-DATA.
05 AB-CDE-FGH.
10 Name PIC X(5).
10 Address PIC X(4).
10 ID PIC X(.
10 Password PIC X(3).

I have created message set for this input file.

Name,Address,ID,Password has fixed length of 5,4,8,8 size
i.e input Sample in Input Q should be 55555444488888888333 or abc(2 spaces)def(1 space)ghijkl(2 spaces)mno etc
So, for this cobol i want to generate some random input in text.
Later i will just copy that random input to message Q (I wont be writing the input in message Q manually).
Back to top
View user's profile Send private message
kimbert
PostPosted: Sat Aug 03, 2013 9:58 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
So, for this cobol i want to generate some random input in text.
Later i will just copy that random input to message Q (I wont be writing the input in message Q manually).
I don't understand *why* you want to do that. What task is this message flow supposed to perform?

Also, which version of the product are you using?
_________________
Before you criticize someone, walk a mile in their shoes. That way you're a mile away, and you have their shoes too.
Back to top
View user's profile Send private message
uniswift
PostPosted: Sat Aug 03, 2013 10:10 am    Post subject: Reply with quote

Newbie

Joined: 03 Aug 2013
Posts: 7

kimbert wrote:
Quote:
So, for this cobol i want to generate some random input in text.
Later i will just copy that random input to message Q (I wont be writing the input in message Q manually).
I don't understand *why* you want to do that. What task is this message flow supposed to perform?

Also, which version of the product are you using?


I dont bother what the message flow does, i just wanted to get auto-generated input sample for cobol file...
advantage is that i will not require to prepare it manually
Thanks
Back to top
View user's profile Send private message
kash3338
PostPosted: Sat Aug 03, 2013 11:03 am    Post subject: Reply with quote

Shaman

Joined: 08 Feb 2009
Posts: 709
Location: Chennai, India

uniswift wrote:
I dont bother what the message flow does, i just wanted to get auto-generated input sample for cobol file...
advantage is that i will not require to prepare it manually


Do you mean to say that you create a message flow just to create sample COBOL messages? That is not what the WMB is for.

After generating input sample for COBOL, what do you do with that? What's your WMB requirement here?
Back to top
View user's profile Send private message Send e-mail
dogorsy
PostPosted: Sat Aug 03, 2013 9:37 pm    Post subject: Reply with quote

Knight

Joined: 13 Mar 2013
Posts: 553
Location: Home Office

uniswift wrote:

I dont bother what the message flow does, i just wanted to get auto-generated input sample for cobol file...
advantage is that i will not require to prepare it manually
Thanks


That is not what you said to start with. You wanted to know the number of fields in the input message and to concatenate them together. So before asking questions, get clear in your mind what you want to do. Then read the documentation and try the examples. There are plenty of them to be downloaded and modified.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » How to Count number of input parameters from Cobol file
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.