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

Problem while writing to TSQ


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

New User


Joined: 28 Feb 2010
Posts: 3
Location: India

PostPosted: Sun Feb 28, 2010 1:08 pm
Reply with quote

Hi,

Below is the sample code am trying to executemy code.....

Code:
PERFORM UNTIL EOF(END OF REC IN DATABASE)
    PERFORM FETCH
    WHEN SQLCODE  = 0
        MOVE RECORDS TO TSQ-DATA
        WRITE TSQ
    WHEN SQLCODE  = 100
        SET EOF

Suppose there are 2 records in database...
Record1
Record2

My TSQ has 4 entries in the following order-
Record1
Record2
Record2
Record1

For the above code, I was expecting only 2 records in TSQ Record1 and Record2.

Not getting to know whats the problem. I would be glad if anyone can help..
Back to top
View user's profile Send private message
avinash pandey

New User


Joined: 10 Apr 2008
Posts: 17
Location: Bangalore

PostPosted: Sun Feb 28, 2010 3:02 pm
Reply with quote

your approach, when DB has the 2 records :

Code:
Perform Until EOF-CURSOR
Exec sql
   Fetch cursor1
   Into :column1
   End-sql
Evaluate sqlcode
When +0
      Count = Count + 1
      Move <8-byte-qid> to Qid
      Move column1 to q-data-area
      Exec cics
             WRITE TSQ
             QID (QID-NAME)
             FROM(Q-DATA-AREA)
             ITEMS(count)
      End-exec
When +100
     Set EOF-CURSOR to true
When other
     DB2-Abend error
End-evaluate

Here two records would be fetched using the cursor and these 2 records would be written to the Queue. Is this what you wanted
Back to top
View user's profile Send private message
Binop B

Active User


Joined: 18 Jun 2009
Posts: 407
Location: Nashville, TN

PostPosted: Mon Mar 01, 2010 11:13 am
Reply with quote

Hi Sweta,

Welcoming you to the forum... icon_smile.gif

Are u deleting the TSQ before starting to write to the queue ?
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 Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts Two input files & writing counter... DFSORT/ICETOOL 12
No new posts AI writing DFSORT, REXX codes.. All Other Mainframe Topics 3
No new posts z/vm installation problem All Other Mainframe Topics 0
No new posts Writing the output file name from a p... JCL & VSAM 7
Search our Forums:

Back to Top