SDSF multiple spool datasets extracted to a single file.



IBM's Command List programming language & Restructured Extended Executor

SDSF multiple spool datasets extracted to a single file.

Postby PJAlarcon » Fri Apr 21, 2017 10:56 pm

Hi,
I'm trying to extract the same spool dataset from several job executions but not getting the desired result, I'm just getting one spool dataset in my output.
The MYJOB job runs 50 times a day, and this job has a spool called OUTPUT, here's my code.
rc=isfcalls("ON")                                                        
 isfcols2="JNAME STEPN DATEE TIMEE"                                      
 isfsort="JNAME A DATEE A TIMEE A"                                        
 isffilter="DATEE EQ 2017.110"                                            
 ISFPRTDDNAME = OUTF                                                      
 ADDRESS SDSF "ISFEXEC ST MYJOB (ALTERNATE DELAYED)"                  
 IF rc<>0 THEN CALL msgrtn                                                
 SAY "No of jobs "||JNAME.0                                              
 IF jname.0 > 0 THEN DO                                                  
   DO j=1 TO JNAME.0                                                
     /* get spool list for selected job */                                
     ADDRESS SDSF "ISFACT ST TOKEN('"TOKEN.j"') PARM(NP ?) (PREFIX JDS_)"
     IF rc<>0 THEN CALL msgrtn                                            
     /* OUTPUT spool dataset is number 21 */                                    
     js=21                                                                
     IF j < JNAME.0 THEN                                                
       ADDRESS SDSF "ISFACT ST TOKEN('"JDS_TOKEN.js"') PARM(NP XF)"    
     ELSE                                                              
       ADDRESS SDSF "ISFACT ST TOKEN('"JDS_TOKEN.js"') PARM(NP XFC)"
   END /* MAIN LOOP */                                                  
 END                                                                    
 rc=isfcalls('OFF')                                                    
 EXIT                                                                  
 

I also tried
SELECT                                                          
   WHEN j = 1 THEN                                                
     DO                                                          
     SAY j||". XF"                                                
     ADDRESS SDSF "ISFACT ST TOKEN('"JDS_TOKEN.js"') PARM(NP XF)"
     END                                                          
   WHEN j = 3 THEN /*JNAME.0 THEN*/                              
     DO                                                          
     SAY j||". XC"                                                
     ADDRESS SDSF "ISFACT ST TOKEN('"JDS_TOKEN.js"') PARM(NP XC)"
     END                                                          
   OTHERWISE                                                      
     DO                                                          
     SAY j||". XF"                                                
     ADDRESS SDSF "ISFACT ST TOKEN('"JDS_TOKEN.js"') PARM(NP X)"
     END                                                        
 
PJAlarcon
 
Posts: 8
Joined: Mon Mar 14, 2011 6:28 pm
Has thanked: 3 times
Been thanked: 0 time

Re: SDSF multiple spool datasets extracted to a single file.

Postby willy jensen » Sat Apr 22, 2017 4:30 pm

you are not opening the actual output file.
The following sample displays file 6 from all the jobs found:

 rc=isfcalls( ON )                                                
 Address SDSF                                                      
                                                                   
 isfprefix='RXOP002'  /* jobname */                                              
 "ISFEXEC ST (prefix job_)"                                        
 if rc>0 then exit msgrtn(rc)                                      
                                                                   
 do ji=1 to job_jname.0                                            
   say  left(job_jname.ji,8) left(job_jobid.ji,8)                  
   /* NP SA does not seem to support the PREFX feature */          
   "ISFACT ST TOKEN('"job_token.ji"') PARM(NP SA)"                
   if rc>0 then exit msgrtn(rc)                                    
   say 'ddname 6:' isfddname.0                                    
   address TSO "EXECIO * DISKR" isfddname.6 "(STEM data. FINIS)"  
   do dn=1 to data.0                                              
     say '>'data.dn                                                
   end                                                            
 end                                                              
 rc=isfcalls( OFF )                                                
 exit                                                              
                                                                   
msgrtn:  procedure  expose  isfmsg  isfmsg2.                      
 arg n                                                            
 if n=0 then return 0                                              
 if  isfmsg<>""  then  Say  "isfmsg  is:"  isfmsg                  
 do  ix=1  to  isfmsg2.0                                          
   Say  "isfmsg2."ix  "is:"  isfmsg2.ix                            
 end                                                              
 return n                                                          
 

These users thanked the author willy jensen for the post:
PJAlarcon (Tue Apr 25, 2017 8:36 pm)
willy jensen
 
Posts: 455
Joined: Thu Mar 10, 2016 5:03 pm
Has thanked: 0 time
Been thanked: 69 times

Re: SDSF multiple spool datasets extracted to a single file.

Postby PJAlarcon » Tue Apr 25, 2017 8:36 pm

Thank you Willy.
I am actually getting the (only one) spool dataset dumped to the JCL allocated OUTF DD. But it seems that every time I issue the PARM(NP XF) command OUTF gets overwritten, so I'm getting just one of the 50 spool datasets instead of all concatenated into just one file as I'd expect. I thought that issuing XF on each of the iterations and XFC on the last would do it. It didn't :(
Anyhow, your suggestion gave me an idea and use DISKW on my OUTF DD instead of the say command.
PJAlarcon
 
Posts: 8
Joined: Mon Mar 14, 2011 6:28 pm
Has thanked: 3 times
Been thanked: 0 time

Re: SDSF multiple spool datasets extracted to a single file.

Postby willy jensen » Tue Apr 25, 2017 10:34 pm

Try EXECIO without FINIS to append output files, like in this snippet:

 cc=bpxwdyn('alloc dd(sysout) da(my.sysout) old reuse')              
  . . .
   do ddn=1 to isfddname.0                                            
     data.1='>>'left(job_jname.ji,8) left(job_jobid.ji,8) 'ddname' isfddname.ddn  
     address tso "execio 1 diskw sysout (stem data.)"                
     address TSO "EXECIO * DISKR" isfddname.ddn "(STEM data. FINIS)"  
     address tso "execio" data.0 "diskw sysout (stem data.)"          
    end                                                                
 . . .
 address tso "execio 0 diskw sysout (finis)"                          
 cc=bpxwdyn('free dd(sysout)')                                        
 
willy jensen
 
Posts: 455
Joined: Thu Mar 10, 2016 5:03 pm
Has thanked: 0 time
Been thanked: 69 times


Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post