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

Can I write o/p(stem) of the REXX pgm to a (PS) file


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ravi.bollineni

New User


Joined: 28 Jun 2006
Posts: 8

PostPosted: Fri Jul 28, 2006 11:35 am
Reply with quote

Hi,

For this I searched in the forum, found the code for writting o/p of the REXX program to a (PS)file. While using the same code with Stem variable, am getting the following error..


*************************************************************
DATA SET IND9437.BEST.REPORT NOT ALLOCATED, FILE IN USE
ENTRY (A) IND9437.BEST.REPORT DELETED
DATA SET IND9437.BEST.REPORT NOT IN CATALOG OR CATALOG CAN NOT BE ACCESSED
MISSING DATA SET NAME+
MISSING NAME OF DATA SET TO BE ALLOCATED
SYMBOLIC PARMS IN VALUE LIST IGNORED - Catalog Space(1,0) CYL DsOrg(PS) RecFm(F) LrecL(133) BlkSize(133)+
COMMAND PROCEDURE HAS NO PROC STMT
INVALID COMMAND NAME SYNTAX
The input or output file OUTPUT is not allocated. It cannot be opened for I/O.
EXECIO error while trying to GET or PUT a record.
FILE DDOUT NOT FREED, IS NOT ALLOCATED
***
*************************************************************
Following is my code:

queue out.

/* out. is a stem variable */

OUTDSNAME = STRIP(USERID())||".best.REPORT"

"Alloc F(OUTPUT)",
"Da('"outdsname"')",
"New Catalog ",
"Space(1,0) CYL DsOrg(PS) RecFm(F) LrecL(133) BlkSize(133)"

/* if the dataset is already allocated, delete and reallocate it*/

If RC <> 0 Then Do
"Delete ('"outdsname"')"
"Alloc F(OUTPUT)",
"Da('"outdsname"')",

"New Catalog ",
"Space(1,0) CYL DsOrg(PS) RecFm(F) LrecL(133) BlkSize(133)"
Rc = 0
End
/* write the queue in OUTPUT dataset */
"Execio" queued() " diskW OUTPUT(finis"


IF RC = 0 THEN
DO
SAY '-------------*****************--------------------'
SAY'OUTPUT DATASET NAME:' || OUTDSNAME
SAY '-------------*****************--------------------'
END;
"FREE F(DDOUT)"
EXIT

*************************************************************

Could you please help me out in this regard. If there is any sample code for writting a stem o/p of the REXX pgm to a Physical sequential file. Please send it to me.


Thanks,
Ravi.
Back to top
View user's profile Send private message
Hanfur

Active User


Joined: 21 Jun 2006
Posts: 104

PostPosted: Fri Jul 28, 2006 12:43 pm
Reply with quote

If there is any sample code for writting a stem o/p of the REXX pgm to a Physical sequential file. Please send it to me.



Ravi,

Given below are two REXX codes.

First one directly writes the stem data to sequential file ASPPNA.IMTF.IN.FILE which is already existing..

---------------------------------------------------------------------------------
/*Allocating file */
"ALLOC DA('ASPPNA.IMTF.IN.FILE') FI(OUTPUT) SHR REUSE"

/*Putting data to stem */
MYSTEM.1 ='Ravis Data'

/*writng stem data to file */
"EXECIO 1 DISKW OUTPUT (FINIS STEM MYSTEM."
"FREE FI(OUTPUT)"

-----------------------------------------------------------------------------------
Now below REXX shows how you can create a new sequential file in to an already existing PDS AAAUTA.INNF.TD.DAFSPMW


MEMNAME='AAAUTA.INNF.TD.DAFSPMW(NEW1)'

/*This will create a new member MEM1 in the existing PDS 'AAAUTA.INNF.TD.DAFSPMW*/

"ALLOC DA('"MEMNAME"') F(DATAOUT) SHR REUSE"


/*putting a value to stem*/

JCLCONCAT.1='Ravis Data'


/*writing value to newly created seq file */

"EXECIO * DISKW DATAOUT(FINIS STEM JCLCONCAT."
"FREE FI(DATAOUT)"

-Han.

Quote:
Back to top
View user's profile Send private message
ravi.bollineni

New User


Joined: 28 Jun 2006
Posts: 8

PostPosted: Fri Aug 04, 2006 12:54 pm
Reply with quote

Hi Hanfur,

Thank you so much. Ur code is working properly.
But the following is one more reason, what went wrong with my previous code.

In my previous code i have defined the Stem variable in the following way.

OUT. = ' ' ;

Due to the above declaration the mentioned abend occured. While writting the Stem variable to the Output dataset it is getting abended. And i have verified the contents in the Dataset, it is having what i was written in the Stem variable and additionally 4000 empty(space) lines are added at the end of the Dataset.

Now i have removed the above declaration and added ur code it is working fine. Once again Thank you very much.


Always Thanking You,
Ravi.
Back to top
View user's profile Send private message
Hanfur

Active User


Joined: 21 Jun 2006
Posts: 104

PostPosted: Fri Aug 04, 2006 9:36 pm
Reply with quote

Hey...It's okey...

Its glad that your problem got solved...

-Han.
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 -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
Search our Forums:

Back to Top