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

Printing data to a dataset from a Panel


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

New User


Joined: 09 Jul 2009
Posts: 14
Location: Stamford, CT

PostPosted: Fri Nov 13, 2009 8:15 pm
Reply with quote

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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Fri Nov 13, 2009 8:22 pm
Reply with quote

Quote:
hw can we avoid.

by writing the program in the correct way!

what other answer did You expect icon_evil.gif

post the code and somebody will be happy to check it for errors
use the code tags please, no attachments
Back to top
View user's profile Send private message
flyingleo

New User


Joined: 09 Jul 2009
Posts: 14
Location: Stamford, CT

PostPosted: Fri Nov 13, 2009 9:35 pm
Reply with quote

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

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Fri Nov 13, 2009 11:17 pm
Reply with quote

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

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Sat Nov 14, 2009 5:27 am
Reply with quote


  1. if you don't use ADDRESS TSO for the ALLOC and the FREE, you don't need to use it for the EXECIO.
  2. 3 ALLOCs and only one FREE.
  3. why not
    Code:
    PRINT.1 = TESTA
    PRINT.2 = TESTB
    PRINT.3 = TESTC
    PRINT.4 = TESTD

  4. always place constants within quotes ('CLIENT.DETAILS').
  5. 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
View user's profile Send private message
flyingleo

New User


Joined: 09 Jul 2009
Posts: 14
Location: Stamford, CT

PostPosted: Wed Nov 18, 2009 12:04 am
Reply with quote

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

Global Moderator


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

PostPosted: Wed Nov 18, 2009 1:36 am
Reply with quote

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

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Wed Nov 18, 2009 10:42 pm
Reply with quote

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
Code:
ARG PARAMS
then split it back using the same character:
Code:
PARSE ARG PARAMS TEST1 ',' TEST2 ',' TEST3 ',' TEST4


But as superk said, you could just do:
Code:
'CMD(%PRODDETL)
and in the program:
Code:
ADDRESS ISPEXEC "VGET (FPROD FREAS FNAME FCONT)"
without passing any argument...
Back to top
View user's profile Send private message
flyingleo

New User


Joined: 09 Jul 2009
Posts: 14
Location: Stamford, CT

PostPosted: Thu Nov 19, 2009 12:04 am
Reply with quote

Thanks Guys icon_biggrin.gif , its works..
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 Store the data for fixed length COBOL Programming 1
No new posts Execute secondary panel of sdsf with ... CLIST & REXX 1
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
Search our Forums:

Back to Top