Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Printing data to a dataset from a Panel

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF
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    Post subject: Printing data to a dataset from a Panel
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10327
Location: italy

PostPosted: Fri Nov 13, 2009 8:22 pm    Post subject: Reply to: Printing a data to Flat file from REXX Panel
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    Post subject: Reply to: Printing data to a dataset from a Panel
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: 1060
Location: Oostende, Belgium

PostPosted: Fri Nov 13, 2009 11:17 pm    Post subject:
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: 1243
Location: Israel

PostPosted: Sat Nov 14, 2009 5:27 am    Post subject:
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    Post subject: Reply to: Printing data to a dataset from a Panel
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

Moderator Team Head


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

PostPosted: Wed Nov 18, 2009 1:36 am    Post subject: Reply to: Printing data to a dataset from a Panel
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: 1243
Location: Israel

PostPosted: Wed Nov 18, 2009 10:42 pm    Post subject: Reply to: Printing data to a dataset from a Panel
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> TSO/ISPF All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts opening a dataset after reading it fr... arunsoods DFSORT/ICETOOL 5 Wed Oct 04, 2017 3:54 pm
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am
No new posts PLI - printing from multiple programs Pedro PL/I & Assembler 8 Fri Sep 08, 2017 6:36 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us