Charles,
 
first of all I apologize because I've totally misunderstood your needs !
 
I should pay a beer for that :D
 
Hope this rexx can help more than the previous sort.
 
Input (FB):
 OSET E    XXXXX.MYREXX.INPUT                        Line 00000000 Col 001 052 
 Command ===>                                                  Scroll ===> CSR  
********************************* Top of Data **********************************
$A...+....1....+....2....+....3....+....4....+....5.
...+....6....+....7$B...+....1....+....2....+....3..
..+....4....+....5....+....6....+....7$C...+....1...
.+....2....+....3....+....4....+....$D....+....2....
+....3$E...+....1....+....2....+....3....+....4$F$G.
******************************** Bottom of Data ********************************
 
Output (VB):
 OSET E    XXXXX.MYREXX.OUTPUT                       Line 00000000 Col 001 080 
 Command ===>                                                  Scroll ===> CSR  
********************************* Top of Data **********************************
$A...+....1....+....2....+....3....+....4....+....5....+....6....+....7    
$B...+....1....+....2....+....3....+....4....+....5....+....6....+....7    
$C...+....1....+....2....+....3....+....4....+....                         
$D....+....2....+....3                                                     
$E...+....1....+....2....+....3....+....4                                  
$F                                                                         
$G.                                                                        
******************************** Bottom of Data ********************************
 
Output:
 
The only arg for rexx is the "read block" that means how many records should it 
read (and write) with a single EXECIO.
Change the DELIM to your delimiter.
 
Rexx:
 
/* REXX */                                                              
PARSE ARG BLOCK_READ .                                                  
BLOCCO = 0                                                              
BLOCCW = 0                                                              
LETTI = 0                                                               
DROP LISTA.                                                             
L = 0                                                                   
DELIM = "$"                                                             
INP_STR = ""                                                            
OUT_STR = ""                                                            
                                                                        
"EXECIO 0 DISKR FILE1"                                                  
"EXECIO 0 DISKW FILE2"                                                  
                                                                        
"EXECIO" BLOCK_READ "DISKR FILE1(STEM INPUT."                           
                                                                        
DO WHILE(INPUT.0 > 0)                                                   
  BLOCCO = BLOCCO + 1                                                   
  SAY "LETTO BLOCCO:" BLOCCO "DI" INPUT.0 "RECORDS"                     
  CALL ELABORA                                                          
  "EXECIO" BLOCK_READ "DISKR FILE1(STEM INPUT."                         
END                                                                     
                                                                        
IF OUT_STR > "" THEN DO                                                 
  L = L + 1                                                             
  LISTA.L = DELIM || OUT_STR                                            
  IF INP_STR > "" THEN DO                                               
    L = L + 1                                                           
    LISTA.L = DELIM || INP_STR                                          
  END                                                                   
END                                                                     
                                                                        
IF L > 0 THEN DO                                                        
  BLOCCW = BLOCCW + 1                                                   
  "EXECIO" L "DISKW FILE2(STEM LISTA."                                  
  SAY "SCRITTO BLOCCO:" BLOCCW "DI" L "RECORDS"                         
END                                                                     
                                                                        
"EXECIO 0 DISKR FILE1(FINIS"                                            
"EXECIO 0 DISKW FILE2(FINIS"                                            
                                                                        
SAY "RECORDS LETTI.......:" LETTI                                       
SAY "RECORDS SCRITTI.....:" (BLOCCW - 1) * BLOCK_READ + L               
                                                                        
EXIT                                                                    
                                                                        
/*----------------------------------------------------------------*/    
ELABORA:                                                                
                                                                        
DO I = 1 TO INPUT.0                                                     
  LETTI = LETTI + 1                                                     
  INP_STR = INP_STR || INPUT.I                                          
  XY = INDEX(INP_STR,DELIM)                                             
  DO WHILE(XY > 0)                                                     
    IF OUT_STR > "" THEN DO                                            
      L = L + 1                                                        
      LISTA.L = DELIM || OUT_STR                                       
      OUT_STR = ""                                                     
      IF L = BLOCK_READ THEN DO                                        
        BLOCCW = BLOCCW + 1                                            
        "EXECIO" L "DISKW FILE2(STEM LISTA."                           
        SAY "SCRITTO BLOCCO:" BLOCCW "DI" L "RECORDS"                  
        L = 0                                                          
      END                                                              
    END                                                                
    OUT_STR = OUT_STR || LEFT(INP_STR,XY-1)                            
    INP_STR = SUBSTR(INP_STR,XY+1)                                     
    XY = INDEX(INP_STR,DELIM)                                          
  END                                                                  
END                                                                    
                                                                       
RETURN                                                                 
 

________________________________
 Da: Charles Mills <[email protected]>
A: [email protected] 
Inviato: Mercoledì 16 Gennaio 2013 16:53
Oggetto: Re: Break a dataset into new record boundaries?
  
> Charles has already solved this?

Yup. 98% anyway.

Charles

-----Original Message-----
From: IBM Mainframe Discussion List [mailto:[email protected]] On
Behalf Of Dave Salt
Sent: Wednesday, January 16, 2013 7:17 AM
To: [email protected]
Subject: Re: Break a dataset into new record boundaries?

As I understand it, Charles has already solved this? But if not, and if help
is still required with writing a macro, let me know.

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to