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
 

 

Problem while writing to TSQ

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CICS
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    Post subject: Problem while writing to TSQ
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    Post subject: Reply to: Problem while writing to TSQ
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    Post subject:
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    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 Problem reading GTF trace output danik56 ABENDS & Debugging 7 Thu Mar 16, 2017 1:02 pm
No new posts Writing on to GSAM variable length rohanthengal JCL & VSAM 6 Fri Mar 03, 2017 7:46 pm
No new posts ROUNDED Problem with COMPUTE statement shalem COBOL Programming 11 Thu Feb 09, 2017 8:16 pm
No new posts SYMNAMES problem jacobdng DFSORT/ICETOOL 7 Thu Dec 22, 2016 7:47 am
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm


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