View previous topic :: View next topic
|
Author |
Message |
flyingleo
New User
Joined: 09 Jul 2009 Posts: 14 Location: Stamford, CT
|
|
|
|
Hi All,
please help me in below issue.
when the user input values in a panel, it in turn writes those values to a dataset. Below are the input details:
Filename: XXXXX.BBBBBB.CCCCC
Reason : TESTING FLAT
NAME : User TEST1
Contact : 12345677
It should be print as below:
XXXXX.BBBBBB.CCCCC
TESTING FLAT
USER TEST1
12345677
But its getting writen as
********************************* Top of Data **********************************
XXXXX.BBBBBB.CCCCC
TESTING
FLAT
FILE USER TEST1 12345677
******************************** Bottom of Data ********************************
when Space appears inbetween words, particular field data get splited and printed in next line, hw can we avoid. any systax ?? |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
by writing the program in the correct way!
what other answer did You expect
post the code and somebody will be happy to check it for errors
use the code tags please, no attachments |
|
Back to top |
|
|
flyingleo
New User
Joined: 09 Jul 2009 Posts: 14 Location: Stamford, CT
|
|
|
|
here is the code which i used to print the data to Flatfile.
Code: |
/* REXX PRODDETL */
ARG TESTA TESTB TESTC TESTD
DDNAME = 'PRINT'
NT = CLIENT.DETAILS
ADDRESS TSO
"ALLOC DS("NT") DD("DDNAME") DSORG(PS) LRECL(80) RECFM(F B)" ,
"OLD REU UNIT(VIO)"
IF RC \= 0 THEN DO
"ISPEXEC SETMSG MSG(ISRZ002)"
EXIT
END
CALL DETAIL
DETAIL :
"ALLOC FI(SYSIN) DUMMY SHR REU"
"ALLOC F(SYSOUT) UNIT(SYSDA) NEW SPACE(5 1) CYL REU"
"ALLOC FI(FNT) MOD DA("NT") REU"
K = 1
PRINT.K = TESTA
K = K + 1
PRINT.K = TESTB
K = K + 1
PRINT.K = TESTC
K = K + 1
PRINT.K = TESTD
K = K + 1
ADDRESS TSO "EXECIO * DISKW PRINT (STEM PRINT. FINIS"
"FREE FI(FNT)"
RETURN |
"Code"d |
|
Back to top |
|
|
prino
Senior Member
Joined: 07 Feb 2009 Posts: 1306 Location: Vilnius, Lithuania
|
|
|
|
And how is the panel coded?
If you want multiple items on one line of the output file, you have to concatenate them, your code is just writing out four lines. |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
- if you don't use ADDRESS TSO for the ALLOC and the FREE, you don't need to use it for the EXECIO.
- 3 ALLOCs and only one FREE.
- why not
Code: |
PRINT.1 = TESTA
PRINT.2 = TESTB
PRINT.3 = TESTC
PRINT.4 = TESTD |
always place constants within quotes ('CLIENT.DETAILS').
Be consistent. If you omit the code using the 3 files, you can omit the ALLOCs as well.
You've got his result because ARG places word1 in TESTA, word2 in TESTB , word3 in TESTC and all the rest in TESTD. |
|
Back to top |
|
|
flyingleo
New User
Joined: 09 Jul 2009 Posts: 14 Location: Stamford, CT
|
|
|
|
here is the panel code, FPROD,FREAS,FNAME, FCONT these are the Four arguments are i am going to pass to the rexx code.
)PROC
&ZSEL=TRANS(TRUNC(&ZCMD,'.')
+,'CMD(%PRODDETL &FPROD &FREAS &FNAME &FCONT)'
' ',' '
X,'EXIT'
*,'?')
)END
in Rexx code, i am receive 4 arugments using
ARG TESTA TESTB TESTC TESTD
due to space, ARG places
word1 in TESTA
word2 in TESTB
word3 in TESTC &
rest in TESTD
do we have any RExx internal commands to avoid this problem, or hw can we recive the value instead of ARG statement? so that data wont get splitted? |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
I'm confused.
Aren't FPROD,FREAS,FNAME, and FCONT your user-defined variables for your ISPF application? If so, then they are readily available from the shared ISPF variable pool to any program that exists within that ISPF application. Your program just needs to refer to them by their name. |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
You can separate the parameters by an unusued character:
Code: |
'CMD(%PRODDETL &FPROD,&FREAS,&FNAME,&FCONT)' |
The rexx program will collect everything as a block
then split it back using the same character:
Code: |
PARSE ARG PARAMS TEST1 ',' TEST2 ',' TEST3 ',' TEST4 |
But as superk said, you could just do:
and in the program:
Code: |
ADDRESS ISPEXEC "VGET (FPROD FREAS FNAME FCONT)" |
without passing any argument... |
|
Back to top |
|
|
flyingleo
New User
Joined: 09 Jul 2009 Posts: 14 Location: Stamford, CT
|
|
|
|
Thanks Guys , its works.. |
|
Back to top |
|
|
|