Hello! I just tried to post a question with embedded code and fixed formatting, 
but it was rejected because HTML is not supported.

So I will post it in plain text, and you can cut/paste into notepad or 3270 to 
see how it lines up. If there is a way to use code blocks here, please let me 
know and I won't do this to you again!

Don

Here is the original note...

Hello there. I am trying to use SORT to process a LISTCAT to give me part of 
the DSN and the creation date. I would normally use Rexx for something like 
this, but have over 100000 filenames I am working on, and thought this might be 
easier - except I can't get it to work. Part of the problem is that the LISTC 
output is a VBA 137 file, and I have not worked much with VB files. Another 
problem is that the data I want is on two different lines. I can strip the file 
down to these two lines, but can't seem to pull off the individual nodes. Here 
is a sample of how my input file looks for those two lines (without the RDW).

----+----1----+----2----+----3----+----4----+----5----+----6-
NONVSAM ------- MYFILE.ABLA.LONGNODE.NODE004.VARNODE1.NOTUSE
       DATASET-OWNER-----(NULL)     CREATION--------2018.341
NONVSAM ------- MYFILE.ABLA.SHORT.NODE4.RPT2.NOTUSE
       DATASET-OWNER-----(NULL)     CREATION--------2015.113
NONVSAM ------- MYFILE.ABLA.MIDDLE.N04.REPT3.NOTUSE
       DATASET-OWNER-----(NULL)     CREATION--------2022.200
NONVSAM ------- MYFILE.ABLA.SHORT.NODE04.RR.NOTUSE
       DATASET-OWNER-----(NULL)     CREATION--------2021.026 

The fields in color are the ones I want to have, and as you can see the purple 
(3rd), red (4th), and green (5th) nodes are variable length.

The output should be one line per file, like this:

----+----1----+----2----+----3----+----4
NODE004  VARNODE1 2018.341 LONGNODE     
NODE4    RPT2     2015.113 SHORT        
N04      REPT3    2022.200 MIDDLE       
NODE04   RR       2021.026 SHORT        

Here is my mess of code, which gives errors about RDW and just doesn't work.

  OPTION COPY,VLSCMP                                                   
  INCLUDE COND=(001,60,SS,EQ,C'NONVSAM -------',OR,                    
                001,60,SS,EQ,C'CREATION--------')                      
  INREC IFOUTLEN=140,                                                  
     IFTHEN=(WHEN=(06,9,CH,EQ,C'NONVSAM -'),                           
      PARSE=(%01=(STARTAFT=C'ABLA.',ENDBEFR=C'.',FIXLEN=8), # NODE3    
             %02=(STARTAFT=C'.',ENDBEFR=C'.',FIXLEN=8),     # NODE4    
             %03=(STARTAFT=C'.',ENDBEFR=C'.',FIXLEN=8))),   # NODE5    
     IFTHEN=(WHEN=(42,9,CH,EQ,C'CREATION-'),                           
      PARSE=(%04=(STARTAFT=C'--------',ENDBEFR=BLANKS,FIXLEN=8)), #DATE
      BUILD=(%02,X,                                                    
             %03,X,                                                    
             %04,X,                                                    
             %01,                                                      
             80:X))                               # BLANK FILL         
  OUTFIL VTOF,INCLUDE=(35,40,SS,EQ,C'CREATION--------') 
/*                                                                     

Am I reasonably close? (I don't think so...) Bonus points would be given to 
convert the date from YYYY.DDD to YYYYMMDD!

Thanks for your help!

Don

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

Reply via email to