/*  REXX  */          
parse arg input                                                                 
                                                                                
"del 'user01.gtfsvc.csv'"                    /* Delete and reallocate output file  */
"alloc fi(csvout) da('user01.gtfsvc.csv') unit(sysda) space(15 15)",
      "track new catalog lrecl(60) blksize(18000) recfm(f b) release"                                                                                
csvout.1 = "SVC,Job Name,PSW,TCB"            /*  Write column headers  */
"execio 1 diskw csvout (stem csvout."                                           
                                                                                
"EXECIO 1 DISKR gtfin (stem gtfin."          /*  Top of input loop  */
do while(rc = 0)                                                                
   if index(gtfin.1, 'SVC.....') > 0 then,   /*  Beginning of an entry */                                     
      do                                                                        
         firstWord = 2                                                          
         if word(gtfin.1, 1) = '1' then,     /*  Deal with page ejects */   
            do                                                                  
               firstWord = 3                                                    
            end                                                                 
         svc = word(gtfin.1, firstWord)      /*  Get SVC, job name and PSW  */
         jobname = word(gtfin.1, firstWord+6)                                   
         psw = word(gtfin.1, firstWord + 8) || ' ' || word(gtfin.1, firstWord+9)
         "EXECIO 1 DISKR gtfin (stem gtfin." /*  Get next line for TCB address  */                                    
         if word(gtfin.1, 1) = '1' then,     /*  Again with the page ejects?  */                                        
            do                                                                  
               tcb = word(gtfin.1, 3)                                           
            end                                                                 
         else,                                                                  
            do                                                                  
               tcb = word(gtfin.1, 2)                                           
            end                                                                 
         csvout.1 = svc || ',' || jobname || ',' || psw || ',' tcb              
         "execio 1 diskw csvout (stem csvout." /*  Build and write output  */
      end                                                                       
   "EXECIO 1 DISKR gtfin (stem gtfin."         /*  Get next line  */
end                                                                             
                                                                                
queue                                          /*  It's all over, go home  */
address tso                                                                     
"execio * diskr gtfin (finis)"                                                  
"execio * diskW csvout (finis)"                                                 
"free fi(csvout)"                          


This was first published in March 2010

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: