Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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: 10231
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: 1002
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: 1226
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: 4648
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: 1226
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 Unable to catalog a gdg dataset resid... Shovan JCL & VSAM 6 Fri Mar 24, 2017 2:24 pm
No new posts Want to pull the job log into a Mainf... Jishu Mukherjee Compuware & Other Tools 9 Tue Mar 21, 2017 4:48 pm
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Append data from two files into a sin... Praveen04 DFSORT/ICETOOL 5 Thu Mar 16, 2017 7:29 pm
No new posts SPUFI -- Joining 3 tables – data in... Sysaron DB2 2 Wed Mar 08, 2017 4:18 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us