During the TSQ write, The ITEM number gets increased abnormally.
First step in the program - Delete TSQ
Second - Write TSQ (Header)
Third - Write TSQ (Detail) - Here my ITEM number is 2, executing at the first time. But After Write process the ITEM number shows some 52 or 26 something. While seeing the output in the screen, First page is being shown at the last.
I am not sure, where i am doing wrong.. I have did programs with similar logic and didn't faced such issue.
Joined: 14 Jan 2008 Posts: 2504 Location: Atlanta, Georgia, USA
Is the TSQ Name unique and does any other program have access to it together with your program? If your answer is NO, then you've got a real dilemma as I've never heard of an error such as this.
When you issue a WRITEQ TS, the Item-Number is automatically incremented by 1 in the CICS Internals or you have the option of specifying the ITEM and NUMITEMS (binary-halfword) in the READQ TS. If you specify NEXT (omit ITEM) in the TSQ READ, the internals will get you the NEXT Item in the TSQ. If you raise the ITEMERR, this means you've reached the end of the TSQ and there aren't any more "Records" (Items) in the TSQ. If you issue a TSQ READ, specifying a value in ITEM (omit NEXT), then you'll either get that "Record" (Item) or you'll raise the ITEMERR. In either example, specifying NUMITEMS for either type of TSQ READ might be beneficial in obtaining the actual number of Items in the TSQ.
You can also issue an INQUIRE TSQUEUE API, to obtain TSQ characteristics. The syntax for this can be found in the System Programmer Reference or you can experiment using CECI (if you're authorized and hopefully not in Production).
I have 3 TSQ's in the same program..
Initially while doing delete i haven't gave the TSQ name correctly for First TSQ, so it was not deleted.
Hence During WriteQ the Item numbers were increased automatically.