Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 10326
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 Moving values to a variable of copybo... Vignesh Sid COBOL Programming 6 Wed Sep 06, 2017 1:04 pm
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm
No new posts Move from Comp3 variable to Edited Va... sreekusr COBOL Programming 8 Thu Aug 10, 2017 4:20 pm
No new posts REXX to get the all datasets name parasmalik20 CLIST & REXX 5 Tue Jul 18, 2017 9:10 pm
No new posts Writing a file using online program grvtomar PL/I & Assembler 3 Fri Jun 30, 2017 1:06 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us