Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to read and then process multiple records through TSQ

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CICS
View previous topic :: :: View next topic  
Author Message
maxsubrat

New User


Joined: 27 Feb 2008
Posts: 72
Location: india

PostPosted: Thu May 24, 2012 4:46 pm    Post subject: How to read and then process multiple records through TSQ
Reply with quote

I have one requirement, the details are:

We are receiving data from other system through TSQ.
rightnow we are receiving one data which has 100 byte length.

There is some enhancement in the current process now..
so as per that we may receive multiple record instead of 1 record to process.
so suppose they sends 2 records to us, and we will receive through TSQ, then the record length will be 100 * 2 = 200 bytes in a single row..

So we need to read the TSQ till end of record..
so if we receive the data in a single row, then how to read the data through TSQ till end of record.
If we read one data, then process the data and so on.. then next record... like that we can finish all the
processings of data...

Can someone give some suggestion how to read the TSQ in this scenerio ?

Thanks
Back to top
View user's profile Send private message

Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7936
Location: Bellevue, IA

PostPosted: Thu May 24, 2012 4:54 pm    Post subject:
Reply with quote

Did you read the manual? Did not this excerpt from the CICS Application Programming Reference manual in the READQ TS section not help?
Quote:
LENGTH(data-area)
specifies the length, as a halfword binary value, of the record to be read.

If you specify the INTO option, LENGTH need not be specified if the length can be generated by the compiler from the INTO variable.

See "LENGTH options in CICS commands" in topic 1.7 for more information about when LENGTH must be specified.

If you specify INTO, LENGTH defines the maximum length of data that the program accepts. If the value specified is less than zero, zero is assumed. If the length of the data exceeds the value specified, the data is truncated to that value and the LENGERR condition occurs.

On completion of the retrieval operation, the data area is set to the original length of the data record read from the queue.

If you specify the SET option, the LENGTH must be specified.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Thu May 24, 2012 6:05 pm    Post subject: Reply to: How to read and then process multiple records thro
Reply with quote

The INQUIRE TSQUEUE/TSQNAME command using keyword NUMITEMS (a binary halfword) will return the number of items (records) in the target TSQUEUE.

This command requires the "SP" option be specified during translation as INQUIRE is a System Programmer command. Check with your Technical Support team and ensure you're allowed to use this option in your shop as its use is suppressed in some.
Back to top
View user's profile Send private message
Peter cobolskolan

Active User


Joined: 06 Feb 2012
Posts: 104
Location: Sweden

PostPosted: Thu May 24, 2012 6:54 pm    Post subject:
Reply with quote

The READQ TS also has a NUMITEMS(), and will give you the number of items in the TSQ at the first READQ TS.
When you READQ TS you will be given the ITEMERR condition when you have read all items.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Thu May 24, 2012 7:10 pm    Post subject: Reply to: How to read and then process multiple records thro
Reply with quote

True, but I took a guess that the OP would have known that, but maybe that was a bad assumption.... icon_wink.gif
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1224
Location: Israel

PostPosted: Thu May 24, 2012 7:28 pm    Post subject: Re: Reply to: How to read and then process multiple records
Reply with quote

Bill O'Boyle wrote:
True, but I took a guess that the OP would have known that, but maybe that was a bad assumption.... icon_wink.gif

Some information (like READQ TS NEXT) is on a need-to-know basis only...
Back to top
View user's profile Send private message
Garry Carroll

Active Member


Joined: 08 May 2006
Posts: 991
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Thu May 24, 2012 7:56 pm    Post subject: Re: Reply to: How to read and then process multiple records
Reply with quote

Marso wrote:
Bill O'Boyle wrote:
True, but I took a guess that the OP would have known that, but maybe that was a bad assumption.... icon_wink.gif

Some information (like READQ TS NEXT) is on a need-to-know basis only...


... or on a 'need-to-be-pointed-out' basis.... ?? icon_rolleyes.gif

Garry
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CICS All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Storing huge volume of data, compare ... Pradeep K M All Other Mainframe Topics 3 Mon Jan 16, 2017 5:08 pm
No new posts Viewing executing process in NDM .. q... Debb.Brant IBM Tools 0 Wed Dec 14, 2016 10:55 pm
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us