View previous topic :: View next topic
|
Author |
Message |
samedesh Currently Banned New User
Joined: 22 May 2007 Posts: 46 Location: India
|
|
|
|
Hi,
I have a dataset in which I have kept some captions which are similar like template type.
Data in dataset:
I want to populate value in front of user1 and user2. The value of user1 and user2 is taken from panel. Now I want to write records from this dataset which will be like for e.g
Code: |
User 1:Alexander
User 2:Hiltler |
Value in front of user1 and user2 will be always changing. I want to write this records to a dataset. How can we apply this logic can anyone suggest? |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
here is a code snippet to meditate on
Code: |
/* read the template file */
Address TSO " EXECIO * READ TMPLDD ( STEM TMPL. FINIS"
/* supposing that the panel fields are named "USER1 USER2 ..... USERn */
/* move the field to the corresponding stemmed variables ,
could be skipped incorporating the logic in the following step,
having different steps is simpler to understand and implement */
do i = 1 to <number of field>
interpret "user.i = user"i
say i a.i
end
/* build the new data records
do i = 1 to tmpl.0
data.i = left(tmpl.i,<alignment length>)
if symbol("user."i) = "VAR" then ,
data.i = data.i || user.i
end
/* write the file */
Address TSO " EXECIO "tmpl.0" WRITE DATADD ( STEM DATA. FINIS"
|
|
|
Back to top |
|
|
samedesh Currently Banned New User
Joined: 22 May 2007 Posts: 46 Location: India
|
|
|
|
Thanks enrico it helped me to build my logic. |
|
Back to top |
|
|
|