On Mon, 26 Aug 2013 14:21:18 -0400, George Shedlock wrote:

>Gentle Listers;
>
>I am trying to write a Rexx routine that takes in 3 arguments. First is DSN, 
>second is Member name, third is a string of text. The string of text is the 
>concatenation of lines delimited by a ";". (ex. "line1;line2;line3").
>
>This code fails:
>
>Write_Member:                                                           
>  MyDSN = ARG(1)                                                        
>  MyMember = ARG(2)                                                     
>  MyArg = ARG(3)                                                        
>  outstem.=0                                                            
>  dsnname = MyDSN || '(' || MyMember || ')'                             
>  Say 'The dsname is: {'dsnname'}'                                      
>  do forever                                                            
>      parse var MyArg  thisword ';' MyArg                               
>      if thisword='' then leave                                         
>      thisword = Left(thisword,80)                                      
>      parse value outstem.0+1 thisword with t outstem.t =1 outstem.0 .  
>      end                                                               
>  Say 'Number of lines written: 'outstem.0                              
>  "ALLOC DA('"dsnname"') F(Pdsout) OLD REUSE"                           
>  "EXECIO * DISKW Pdsout (STEM outstem. FINIS"                          
>  "FREE F(Pdsout)"                                                      
>  Return                                                                
>
I can't spot a problem.  Try it with "trace R".  That's often illuminating.

The "parse" is cute; I hadn't thought of that of that as a way of
combining 3 instructions to one.

Hmmm.  What terminates EXECIO?  Try:

    "EXECIO" outstem.0 "DISKW Pdsout (STEM outstem. FINIS"
                            
>System abend code E37, reason code 00000004.           

-- gil

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to