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

help on WRITE to DS


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rama velati

New User


Joined: 27 Feb 2008
Posts: 5
Location: india

PostPosted: Fri Jul 31, 2009 1:03 pm
Reply with quote

I have written a rexx routine to read a JCL and find a particular string and move that to a array (stem variable)

when i display the stem the required value appears, but when i write it to the DS i am getting an empty one, why is this. the rexx is given below

Code:

...   
i = 0                                                       
l = 0                                                       
"EXECIO * DISKR in (STEM input."                               
name. =""                                                   
do j = 1 to input.0                                           
   len = length(input.j)                                     
   string1 = SUBSTR(input.j,1,5)                             
    if string1 = 'LOGON' then                                 
       i = j                                                 
    else                                                     
     if i \= 0 then                                           
     do                                                       
     name.l = input.j                                         
     say name.l                       
    "EXECIO * DISKW out (FINIS"
     i = 0                             
     end                               
end
Back to top
View user's profile Send private message
prino

Senior Member


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

PostPosted: Fri Jul 31, 2009 1:15 pm
Reply with quote

You should use
Code:
PSYCHICIO * DISKW out(FINIS

to write the item, as that would probably be able to guess what you want to write out.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Fri Jul 31, 2009 1:32 pm
Reply with quote

Use the same syntax as you did to READ a file.
Back to top
View user's profile Send private message
rama velati

New User


Joined: 27 Feb 2008
Posts: 5
Location: india

PostPosted: Fri Jul 31, 2009 3:39 pm
Reply with quote

i have

"EXECIO * DISKW out(STEM name."

i want to write the matched records to a new file, for this i have created a new stem name. and i am moving values, but nothing gets written to the DS.

strange also, if is display name. before the EXECIO, i get the data, but if i write after the EXECIO, i get blank.

why is the output stem not written to the DS?
Back to top
View user's profile Send private message
prino

Senior Member


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

PostPosted: Fri Jul 31, 2009 3:48 pm
Reply with quote

RTFM

The REXX manual has a very detailed explanation about the EXECIO "DISKW" function!
Back to top
View user's profile Send private message
anjali_tcs

New User


Joined: 09 Jun 2008
Posts: 10
Location: GGN

PostPosted: Fri Jul 31, 2009 4:47 pm
Reply with quote

Rama -
Can i see your latest code....as much as i know of REXX

"EXECIO * DISKW out (STEM name."

should get you some thing (not necessarily what u are looking for) in the output file.

Thanks,
AB.
Back to top
View user's profile Send private message
rama velati

New User


Joined: 27 Feb 2008
Posts: 5
Location: india

PostPosted: Fri Jul 31, 2009 4:54 pm
Reply with quote

hi,

no nothing gets written, but if i say

"EXECIO * DISKW OUT(STEM input." (input. is the stem variable for the input jcl, the complete jcl gets written

but when i change it to

"EXECIO * DISKW OUT(STEM name."

nothing is
Back to top
View user's profile Send private message
anjali_tcs

New User


Joined: 09 Jun 2008
Posts: 10
Location: GGN

PostPosted: Fri Jul 31, 2009 5:04 pm
Reply with quote

i think you are intializing the 0 element (i.e. l=0) of your stem variable (name) with the text.

Zero th element of the stem contains the count of elements in the stem.
You should have l initialized to 1 and then check...

Hopefully it will work.

Thanks,
AB.
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Fri Jul 31, 2009 5:13 pm
Reply with quote

Your statement name. = "" should probably be drop name.

You assign the value into name.L -- where is L set other than in the 2nd line where it is set to zero? EXECIO will not write out the zero-th item.

EXECIO will output details from name.1 until it reaches a null name.

Garry.
Back to top
View user's profile Send private message
rama velati

New User


Joined: 27 Feb 2008
Posts: 5
Location: india

PostPosted: Fri Jul 31, 2009 5:29 pm
Reply with quote

thnx, finally worked
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(F1 & F2) and writ... JCL & VSAM 8
No new posts Write line by line from two files DFSORT/ICETOOL 7
This topic is locked: you cannot edit posts or make replies. How To Write, Compile and Execute Cob... COBOL Programming 5
No new posts Compare two files with a key and writ... SYNCSORT 3
No new posts JCL to write the log on to a PDS file JCL & VSAM 10
Search our Forums:

Back to Top