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

Basic "SAY/PULL/DISKW" pgm. Need help tho...


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Kevin Santos

New User


Joined: 27 Jan 2009
Posts: 26
Location: toronto

PostPosted: Tue Feb 10, 2009 11:29 pm
Reply with quote

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

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Tue Feb 10, 2009 11:41 pm
Reply with quote

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

New User


Joined: 27 Jan 2009
Posts: 26
Location: toronto

PostPosted: Wed Feb 11, 2009 12:15 am
Reply with quote

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

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Wed Feb 11, 2009 12:29 am
Reply with quote

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

New User


Joined: 27 Jan 2009
Posts: 26
Location: toronto

PostPosted: Wed Feb 11, 2009 12:41 am
Reply with quote

superk, i coded the push and the exact execio stmt
ok it's writing something, actually writing a blank line.
Back to top
View user's profile Send private message
Kevin Santos

New User


Joined: 27 Jan 2009
Posts: 26
Location: toronto

PostPosted: Wed Feb 11, 2009 2:12 am
Reply with quote

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
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 PuTTY - "User is not a surrogate... IBM Tools 5
No new posts Newbie Stuck on "Duplicate Datas... TSO/ISPF 5
No new posts RABBIT HOLE NEEDED - "Live"... All Other Mainframe Topics 0
No new posts Compiler and run JCL for basic PL/I p... PL/I & Assembler 10
No new posts Using PARM=('JPn"&SYMBOL&quo... DFSORT/ICETOOL 2
Search our Forums:

Back to Top