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

Write records to output file pulling from panels


IBM Mainframe Forums -> TSO/ISPF
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rikdeb

New User


Joined: 19 Jan 2009
Posts: 63
Location: hyderabad

PostPosted: Sun Nov 23, 2014 2:00 am
Reply with quote

Hi All..
Not much familiar with REXX. I am trying to design a rexx module where i will be using a panel(panel is there already built) to accept user input (say IDno) and write this IDno to a file.When multiple users through out the day uses the tool, IDnos will be appended to the file.
Could you please provide ur help and suggestions to proceed.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2448
Location: Hampshire, UK

PostPosted: Sun Nov 23, 2014 4:51 am
Reply with quote

allocate file as mod
Use EXCIO to write the data (Rexx variable is the same as the panel variable)
Back to top
View user's profile Send private message
rikdeb

New User


Joined: 19 Jan 2009
Posts: 63
Location: hyderabad

PostPosted: Sun Nov 23, 2014 3:54 pm
Reply with quote

Hi..
Tried using the execio syntax , but could not find a proper solution.This is what i am trying. V3 is my pannel variable
Code:
/* REXX TESTREXX */
START:                                             
"DISPLAY PANEL(TST)"                               
 IF PFPRSD = 'PF03' THEN                           
     EXIT                                         
ADDRESS "TSO"                                     
"ALLOC FILE(OUT) DA('IXXXX.SORT.OUTPUT') MOD "   
"EXECIO  "V3.0" DISKW OUT (FINIS STEM V3"         
"FREE F(OUT)"                                     
EXIT                                               

I want to append the IDnos

Using the above code, if i give the inpjut 2121..its giving wrong OP.
V2.1
...
V3.2118
V3.2119
V3.2120
V3.2121
Back to top
View user's profile Send private message
rikdeb

New User


Joined: 19 Jan 2009
Posts: 63
Location: hyderabad

PostPosted: Sun Nov 23, 2014 11:40 pm
Reply with quote

After several trials..i reached to a solution which i am sharing below..
But more enhanced/optimized solution if any , please provide. m just beginner in rexx
Code:
 /* REXX TESTREXX */                           
 ADDRESS "ISPEXEC"                             
"LIBDEF ISPPLIB DATASET ID('I1XXX.REXX.PANEL')"
START:                                         
"DISPLAY PANEL(TST)"                           
 IF PFPRSD = 'PF03' THEN                       
     EXIT                                       
ADDRESS "TSO"                                   
"ALLOC FILE(OUT) DA('IXXXX.REXX.OUTPUT') MOD "
"EXECIO  1  DISKW OUT (STEM "V3"  FINIS)"       
"FREE F(OUT)"                                   
EXIT                                           
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8794
Location: Welsh Wales

PostPosted: Mon Nov 24, 2014 2:57 pm
Reply with quote

Questions

If V3 is the panel defined variable, why are you using it as a stem ?

Why do you NOT check the return code from the allocation ?
Will this be used by concurrent users ? If yes then you really do need to check if the allocation worked or not.

Will there be multiple entries from one user - if so then that looks like they will need to re execute the REXX every time
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 -> TSO/ISPF

 


Similar Topics
Topic Forum Replies
No new posts Command line placement in DB2I panels TSO/ISPF 2
No new posts Converting a file from PD to display ... SYNCSORT 4
No new posts Merging more than two records DFSORT/ICETOOL 15
No new posts Matching and non matching records usi... DFSORT/ICETOOL 11
No new posts Record count of RECFM=U tape file DFSORT/ICETOOL 17
Search our Forums:

Back to Top