View previous topic :: View next topic
|
Author |
Message |
Kevin Santos
New User
Joined: 27 Jan 2009 Posts: 26 Location: toronto
|
|
|
|
the program is to
1) display(say) a few questions on the screen,
2) reads(pull) the answers given
3) appends (diskw shr reuse) the answers to an existing FB-80 flat file. the flat file grows by 1 new record everytime this rexx pgm executes on demand.
my question is how to code(#3) so that all the answers(variables) typed on the screen are written to the file in one line separated by a space, as one record? |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
concatenate the variables. example:
Code: |
a = 'Pedro'
b = '123 Any Street'
c = 'Hometown, USA'
d = a b c
|
The use EXECIO to append to the file |
|
Back to top |
|
|
Kevin Santos
New User
Joined: 27 Jan 2009 Posts: 26 Location: toronto
|
|
|
|
d = a b c
how do i get d to OUTREC ?
"ALLOC FI(OUTREC) DA('kEVINS.OUTPUT') SHR REUSE"
"EXECIO * DISKW OUTREC ( FINIS" |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
If you're APPENDING to a dataset, then you need to specify MOD for the disposition:
ALLOC FI(OUTREC) DA('KEVINS.OUTPUT') MOD REUSE in TSO/E or
//OUTREC DD DSN=KEVINS.OUTPUT,DISP=MOD in JCL.
If you PULL data into the stack, then you PUSH it back out:
...
PUSH a b c
"EXECIO 1 DISKW OUTREC"
... |
|
Back to top |
|
|
Kevin Santos
New User
Joined: 27 Jan 2009 Posts: 26 Location: toronto
|
|
|
|
superk, i coded the push and the exact execio stmt
ok it's writing something, actually writing a blank line. |
|
Back to top |
|
|
Kevin Santos
New User
Joined: 27 Jan 2009 Posts: 26 Location: toronto
|
|
|
|
Nevermind. fixed my code:
FYI: this worked -
ANSWERS.1 = ans1 ans2 ans3
"ALLOC FI(OUTREC) DA('KEVINS.OUTPUT') MOD REUSE"
"EXECIO" 1 "DISKW OUTREC (STEM ANSWERS." |
|
Back to top |
|
|
|