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

Duplicate data in PUT CONTAINER using APPEND


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

New User


Joined: 15 Sep 2022
Posts: 4
Location: Unites States

PostPosted: Thu Dec 15, 2022 2:51 pm
Reply with quote

Hi,

Can somebody help with this issue, appreciate t all help.

I have some set data in an array that Im writing into a container one by one.

Im writing set of data into the container using PUT CONTAINER with APPEND from the very first PUT.
Code:
Add +1 to Name-num
EXEC CICS PUT CONTAINER(WS-CONT-NAME)     
     CHANNEL(WS-CH-NAME)                 
     FROM(NAME-CONTAINER)                 
     RESP(COMMAND-RESP) RESP2(COMMAND-RESP2)   
     APPEND                                   
END-EXEC                                       



Employee Set 1
John
Mark
Matt

When I write the Employee2, it repeats the first set again and then start appends with new data

Employee Set 2
John
Mark
Matt
Pam
Rud
Doug

Expected Output:

Employee Set 2
Pam
Rud
Doug
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10838
Location: italy

PostPosted: Thu Dec 15, 2022 3:32 pm
Reply with quote

did you care to read the manual ???

www.ibm.com/docs/en/cics-ts/5.3?topic=summary-put-container-channel


the topic with the same question in the sibling forum has been deleted
people answering thee are the same answering here
Back to top
View user's profile Send private message
rocketz

New User


Joined: 15 Sep 2022
Posts: 4
Location: Unites States

PostPosted: Thu Dec 15, 2022 9:47 pm
Reply with quote

Thanks did refer the manual, and tried removing Append first time insert and use Append after that, but doesn't seem to be working. Am I missing anything here, please advise.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8661
Location: Dubuque, Iowa, USA

PostPosted: Fri Dec 16, 2022 3:47 am
Reply with quote

If you are wanting the data replaced, why are you specifying APPEND anyway? From the manual:
Quote:
APPEND
Specifies that the data passed to the container is appended to the existing data in the container. If this option is not stated, the existing data in the container is overwritten by the data passed to the container.

In other words, the system is doing precisely what it should be doing based upon your command.
Back to top
View user's profile Send private message
rocketz

New User


Joined: 15 Sep 2022
Posts: 4
Location: Unites States

PostPosted: Fri Dec 16, 2022 4:59 am
Reply with quote

Actually I dont want the data to be append for the 2nd group with 1st group, rather every group should be a fresh insert.

In my example I put JOHN into the container then increment name-num by 1 then put MARK, increment name-num by 1 and then put MATT, increment name-num.

First group works fine

Employee group1{
John
Mark
Matt}

Then, when start writing the 2nd group, I put PAM into the container then increment name-num by 1 then put RUD, increment name-num by 1 and then put DOUG increment name-num. Now name-num is 6, when i look at the result I see system has taken previous array as well, something like below.

System Output:
Employee group2{
John
Mark
Matt
Pam
Rud
Doug}

i want the data to appended within the group but not append the first group data into the 2nd group.

My Expected Output:

Employee group2{
Pam
Rud
Doug}

Not sure if i explained comprehensively, but any idea or help is appreciated whether i should initialize container before group2 put or reset name-num.
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 How to extract the data for current y... DFSORT/ICETOOL 8
No new posts I want to append a record in an exist... CLIST & REXX 17
No new posts Split a record with data in a differe... DFSORT/ICETOOL 8
No new posts data moved using MVI on para-name. PL/I & Assembler 4
No new posts Setting CA7 user variable from data s... CA Products 7
Search our Forums:

Back to Top