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
 

 

How to move rexx output to a dataset?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
yash_g

New User


Joined: 24 Feb 2011
Posts: 4
Location: Bangalore

PostPosted: Thu Feb 24, 2011 12:35 pm    Post subject: How to move rexx output to a dataset?
Reply with quote

The below code prints all the datasets with the given hiqualifier. Can you help me in getting this to a dataset?

"ISPEXEC LMDINIT LISTID(IDV) LEVEL(JSUDSA.DSADFAU.DT*)"
DO FOREVER
"ISPEXEC LMDLIST LISTID("IDV") OPTION(LIST) DATASET(DSVAR)"
IF RC = 0 THEN SAY "'"DSVAR"'"
ELSE LEAVE
END
"ISPEXEC LMDLIST LISTID("IDV") OPTION(FREE)"
Back to top
View user's profile Send private message

yugendran

New User


Joined: 14 Dec 2007
Posts: 51
Location: indore

PostPosted: Thu Feb 24, 2011 12:39 pm    Post subject: Reply to: How to move rexx output to a dataset?
Reply with quote

Use just EXECIO for writing it into dataset.. just populate the values of DSNVAR into a stem variable and write that stem variable into the dataset..
Back to top
View user's profile Send private message
yash_g

New User


Joined: 24 Feb 2011
Posts: 4
Location: Bangalore

PostPosted: Thu Feb 24, 2011 12:44 pm    Post subject: Thanks for the reply
Reply with quote

I tried using EXECIO as below
/* REXX */
"ISPEXEC LMDINIT LISTID(IDV) LEVEL(HIQUAL.FILE.DT*)"
DO FOREVER
"ISPEXEC LMDLIST LISTID("IDV") OPTION(LIST) DATASET(DSVAR)"
IF RC = 0 THEN
DO
OUTVR = '"DSVAR"'
SAY "'"DSVAR"'"
"EXECIO 0 DISKW MYOUTD (STEM OUTVR. FINIS"
"FREE F(OUT)"
END
ELSE LEAVE
END

But when i run this through a job using MYOUTD as DD for my output dataset, nothing happens. The jo runs with a RC=0 but nothing goes into output file.
"ISPEXEC LMDLIST LISTID("IDV") OPTION(FREE)"
EXIT
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Feb 24, 2011 1:24 pm    Post subject:
Reply with quote

had you posted your code with code tags,
you could have seen your error.
Code:

/* REXX */
"ISPEXEC LMDINIT LISTID(IDV) LEVEL(HIQUAL.FILE.DT*)"
DO FOREVER
  "ISPEXEC LMDLIST LISTID("IDV") OPTION(LIST) DATASET(DSVAR)"
  IF RC = 0 THEN
     DO
       OUTVR = '"DSVAR"'
       SAY "'"DSVAR"'"
       "EXECIO 0 DISKW MYOUTD (STEM OUTVR. FINIS"
       "FREE F(OUT)"
     END
  ELSE LEAVE
END

try this:
Code:

/* REXX */
"ISPEXEC LMDINIT LISTID(IDV) LEVEL(HIQUAL.FILE.DT*)"
OUTVR. = ""
OUTVR.0 = 0
DO FOREVER
  "ISPEXEC LMDLIST LISTID("IDV") OPTION(LIST) DATASET(DSVAR)"
  IF RC = 0 THEN
     DO
       OUTVR.0 = OUTVR.0 + 1
       i = OUTVR.0
       OUTVR.i = '"DSVAR"'
       SAY "'"DSVAR"'"
     END
  ELSE LEAVE
END
"EXECIO DISKW MYOUTD (STEM OUTVR. FINIS"
"FREE F(OUT)"

[/code]
Back to top
View user's profile Send private message
yash_g

New User


Joined: 24 Feb 2011
Posts: 4
Location: Bangalore

PostPosted: Thu Feb 24, 2011 1:40 pm    Post subject: i still dont get it :(
Reply with quote

Added * to "EXECIO DISKW MYOUTD (STEM OUTVR. FINIS"

But its till not working.
The RC is 0 and i get the following message in job
ACF0C038 ACF2 LOGONID ATTRIBUTES HAVE REPLACED DEFAULT USER ATTRIBUTES
FILE OUT NOT FREED, IS NOT ALLOCATED
READY
END

My Job is
//Step01 EXEC PGM=IKJEFT01,PARM='REXCODE',DYNAMNBR=20
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSEXEC DD DSN=REX.LIB,DISP=SHR
//MYOUTD DD DSN=FILES.YASH,DISP=SHR
//SYSTSIN DD DUMMY

i am a REXX beginner. Apologies if a am missing somthing very basic. icon_redface.gif
Back to top
View user's profile Send private message
yugendran

New User


Joined: 14 Dec 2007
Posts: 51
Location: indore

PostPosted: Thu Feb 24, 2011 3:19 pm    Post subject: Reply to: How to move rexx output to a dataset?
Reply with quote

Is it showing any displays in batch mode? cuz i believe if u hav to run the ISPEXEC commands, u have to do something more..

but u can easily do this in foreground.. use the below one for allocate and write..

OutDSN = 'FILES.YASH'
"Alloc dd(OutDSN) da('"OutDSN"') OLD REU"
"ExecIO * Diskw OutDsn (stem OutVr. finis"
"Free dd(OutDsn)"
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2422
Location: Netherlands, Amstelveen

PostPosted: Thu Feb 24, 2011 3:27 pm    Post subject:
Reply with quote

Since your file is allocated in your jcl and not by an ALLOC statement you
will get that message.
And the ACF message is an informational message.
So what to worry about, Dick gave you a working solution and know what,
its for free.
Back to top
View user's profile Send private message
yash_g

New User


Joined: 24 Feb 2011
Posts: 4
Location: Bangalore

PostPosted: Thu Feb 24, 2011 5:14 pm    Post subject:
Reply with quote

Thanks for your inputs...
yugendran..your methord worked!! Thanks again!

Cheers,
Yash
Back to top
View user's profile Send private message
Pedro

Senior Member


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

PostPosted: Fri Feb 25, 2011 11:00 pm    Post subject: Reply to: How to move rexx output to a dataset?
Reply with quote

Know your services!

Instead of OPTION(LIST):
Code:
"ISPEXEC LMDLIST LISTID("IDV") OPTION(LIST) DATASET(DSVAR)"


Use OPTION(SAVE):
Code:
"ISPEXEC LMDLIST LISTID("IDV") OPTION(SAVE) DATASET(DSVAR)"


And I believe this option saves the whole list, so you not have to have a loop in your program.
Back to top
View user's profile Send private message
jerryte

Active User


Joined: 29 Oct 2010
Posts: 183
Location: Toronto, ON, Canada

PostPosted: Thu Mar 17, 2011 8:15 pm    Post subject:
Reply with quote

You can also use the LISTCAT tso command and do an OUTTRAP in rexx like so:
Code:

CALL OUTTRAP 'dsnvar.'   
"LISTC LVL(HILVLQL.Q2)"
CALL OUTTRAP 'OFF'
 


Then a rexx DO loop to process the stem. The dataset name appears on every other line
Code:

DO i = 1 to dsnvar.0
  PARSE VAR dsnvar.i '---' dsname .
END


Create another stem to hold the dataset name and then use EXECIO to write it out.
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 -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. How to move a long alphanumeric data ... lind sh COBOL Programming 8 Mon Dec 05, 2016 7:51 pm
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 6 Fri Nov 18, 2016 1:48 pm
No new posts FTP - JCL failed while passing FTP co... Suneetha1612 JCL & VSAM 12 Wed Nov 16, 2016 7:33 pm
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm
No new posts Syncsort - Hard coded Value in output PORYES SYNCSORT 1 Thu Nov 03, 2016 9:23 am


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