Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Writing datasets with variable value

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: Writing datasets with variable value
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10256
Location: italy

PostPosted: Mon Jun 08, 2009 1:25 pm    Post subject: Reply to: Writing datasets with variable value
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    Post subject: Reply to: Writing datasets with variable value
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    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
This topic is locked: you cannot edit posts or make replies. SDSF multiple spool datasets extracte... PJAlarcon CLIST & REXX 1 Fri Apr 21, 2017 10:50 pm
No new posts Edit large number of datasets (QSAM) zh_lad TSO/ISPF 3 Tue Apr 04, 2017 6:08 pm
No new posts Writing on to GSAM variable length rohanthengal JCL & VSAM 6 Fri Mar 03, 2017 7:46 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us