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

Clist problem while writting muliple records in PS


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
vsk_2407

New User


Joined: 20 Feb 2005
Posts: 3
Location: india

PostPosted: Mon Jun 14, 2010 5:19 pm
Reply with quote

I'm trying to write multiple records into a PS. But I'm unable to do so. The record is being updated with the latest one.

Eg:

I want to write a PS as :

111111,111111,11111,11111,Y,ERD,Y
222222,111111,11111,11111,Y,ERD,Y

The record is written only once and the latest record is seen.The Code used by me is :

Code:

ALLOCATE FILE(TEST) DA('NUAEA62.APP.TEST(DUMMY)') SHR               
OPENFILE TEST OUTPUT             
ISPEXEC VGET (INP)                                                   
DO UNTIL &INP = Y                                                   
  SET TEST=&CONFIGID,&DELCUST,&DELADD,&ACTCUST,&ENCRY,+         
                   &REPTTYPE,&EXTRAC
    PUTFILE TEST           /* Write new value to data set */         
END                                                                 
CLOSFILE TEST                                                     
FREE F(TEST)
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Mon Jun 14, 2010 6:00 pm
Reply with quote

I'm not a CLIST expert, but, first of all, your topic says that you want to write multiple records to a PS, yet your example shows the target dataset as a PDS.

You use the ISPF service ISPEXEC VGET (INP) outside of the loop. Shouldn't it be inside the loop? I can't see how it would be able to control the number of iterations of the loop if it's not checked each time.
Back to top
View user's profile Send private message
vsk_2407

New User


Joined: 20 Feb 2005
Posts: 3
Location: india

PostPosted: Mon Jun 14, 2010 6:28 pm
Reply with quote

I have tried that ISPF function inside the loop.Yet, same problem
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Mon Jun 14, 2010 6:29 pm
Reply with quote

Where do you populate the &INP that comes from the VGET.
Please show the code used.
Back to top
View user's profile Send private message
vsk_2407

New User


Joined: 20 Feb 2005
Posts: 3
Location: india

PostPosted: Mon Jun 14, 2010 6:33 pm
Reply with quote

It is populated in the Screen.The user provides that Input.

The Code for giving that input was provided earlier
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Mon Jun 14, 2010 6:37 pm
Reply with quote

vsk_2407 wrote:
The Code for giving that input was provided earlier
Really, where.

Where is the code that that performs VPUT
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Mon Jun 14, 2010 6:42 pm
Reply with quote

I think there are sections of the code not being shown, like where values for all of those variables like &CONFIGID, &DELCUST, &DELADD, &ACTCUST, &ENCRY, &REPTTYPE, and &EXTRAC are being set. This code almost looks like a sub-routine rather than a stand-alone program.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Mon Jun 14, 2010 6:52 pm
Reply with quote

I should imagine that the OP is doing multiple VPUTs somewhere and doesn't quite grasp the concept that each VPUT over writes the data stored by the previous VPUT.
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Mon Jun 14, 2010 7:07 pm
Reply with quote

I dunno. I feel pretty confident that, if you OPENFILE the file, perform multiple PUTFILE's, and then CLOSFILE it, they you'll have one record for each PUTFILE you called.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Mon Jun 14, 2010 7:11 pm
Reply with quote

Well, without ever seeing the pertinent pieces of code to know what's going on, there's not too much left to say.

I just went for a psychic day special with my guesstimate of multiple VPUTs.
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 -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
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 CLIST - Virtual storage allocation error CLIST & REXX 5
Search our Forums:

Back to Top