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
 

 

help on WRITE to DS

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: help on WRITE to DS
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

Active Member


Joined: 07 Feb 2009
Posts: 989
Location: Oostende, Belgium

PostPosted: Fri Jul 31, 2009 1:15 pm    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Fri Jul 31, 2009 1:32 pm    Post subject:
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    Post subject:
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

Active Member


Joined: 07 Feb 2009
Posts: 989
Location: Oostende, Belgium

PostPosted: Fri Jul 31, 2009 3:48 pm    Post subject:
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    Post subject: r u sure?
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    Post subject:
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    Post subject:
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

Active Member


Joined: 08 May 2006
Posts: 991
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Fri Jul 31, 2009 5:13 pm    Post subject:
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    Post subject:
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    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
No new posts Error IEC161I 052(009,XXXRS00)-084 wh... amitc23 JCL & VSAM 10 Wed Oct 12, 2016 5:00 pm
No new posts how to DYNAMICALLY write sort cond to... mohamedmubee COBOL Programming 13 Fri Aug 26, 2016 11:46 pm
No new posts Compare 2 files & write Indicator... nagendrapgupta SYNCSORT 5 Sun May 15, 2016 10:42 am
No new posts DFSORT to match two files and write John F Dutcher DFSORT/ICETOOL 6 Thu May 12, 2016 5:17 pm
No new posts Write a job to delete the files aging... Abhinav Roy JCL & VSAM 4 Fri Dec 18, 2015 7:17 pm


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