View previous topic :: View next topic
|
Author |
Message |
vsk_2407
New User
Joined: 20 Feb 2005 Posts: 3 Location: india
|
|
|
|
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 |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
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 |
|
|
vsk_2407
New User
Joined: 20 Feb 2005 Posts: 3 Location: india
|
|
|
|
I have tried that ISPF function inside the loop.Yet, same problem |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Where do you populate the &INP that comes from the VGET.
Please show the code used. |
|
Back to top |
|
|
vsk_2407
New User
Joined: 20 Feb 2005 Posts: 3 Location: india
|
|
|
|
It is populated in the Screen.The user provides that Input.
The Code for giving that input was provided earlier |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
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 |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
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 |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
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 |
|
|
|