IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to read and then process multiple records through TSQ


IBM Mainframe Forums -> CICS
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
maxsubrat

Active User


Joined: 27 Feb 2008
Posts: 110
Location: india

PostPosted: Thu May 24, 2012 4:46 pm
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: 8696
Location: Dubuque, Iowa, USA

PostPosted: Thu May 24, 2012 4:54 pm
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: 2501
Location: Atlanta, Georgia, USA

PostPosted: Thu May 24, 2012 6:05 pm
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
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: 2501
Location: Atlanta, Georgia, USA

PostPosted: Thu May 24, 2012 7:10 pm
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: 1353
Location: Israel

PostPosted: Thu May 24, 2012 7:28 pm
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

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Thu May 24, 2012 7:56 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CICS

 


Similar Topics
Topic Forum Replies
No new posts Error to read log with rexx CLIST & REXX 11
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
Search our Forums:

Back to Top