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

Writing datasets with variable value


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

New User


Joined: 22 May 2007
Posts: 46
Location: India

PostPosted: Mon Jun 08, 2009 1:08 pm
Reply with quote

Hi,

I have a dataset in which I have kept some captions which are similar like template type.

Data in dataset:
Code:
User 1 :
User 2:


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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Mon Jun 08, 2009 1:25 pm
Reply with quote

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
View user's profile Send private message
samedesh
Currently Banned

New User


Joined: 22 May 2007
Posts: 46
Location: India

PostPosted: Tue Jun 09, 2009 12:46 pm
Reply with quote

Thanks enrico it helped me to build my logic.
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 Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Two input files & writing counter... DFSORT/ICETOOL 12
No new posts Variable Output file name DFSORT/ICETOOL 8
No new posts Moving Or setting POINTER to another ... COBOL Programming 2
No new posts parsing variable length/position data... DFSORT/ICETOOL 5
Search our Forums:

Back to Top