Page 1 of 1

Every record doesn't contain all data

PostPosted: Mon Feb 18, 2013 8:35 pm
by LasseH
I admit, I'm having problem to find the right "search" argument

Problem:
Trying to create some Librarian statements from a Librarian Index listing

Input:

AAGG002B   0 13/01/22 10:10 SPJH PSTB       
                 -1 13/01/22 10:10 SPJH PSTB       
AAGP006    0 13/01/28 15:02 XVPC HOBA/PAKA   
                -1 13/01/28 15:02 XVPC HOBA/PAKA   
AAGP006O   0 12/11/22 07:44 PBBK HOBA/PAKA   
AAGP006S   0 12/07/12 15:13 BLHV HOBA/PAKA


Colums are: Membername(2,8) arclevel(10,4) date(15,8) time(24,5) .....

Requested output:

-EXTRACT AAGG002B,ARC=-1
-EXTRACT AAGG002B,ARC=-0
-EXTRACT AAGP006,ARC=-1
-EXTRACT AAGP006,ARC=-0


Is this possible with DFSort?
//Lasse

Code'd

Re: Every record doesn't contain all data

PostPosted: Mon Feb 18, 2013 8:39 pm
by LasseH
The input didn't came out right:

AAGG002B  0 13/01/22 10:10 SPJH PSTB
         -1 13/01/22 10:10 SPJH PSTB   <- membername blank
AAGP006   0 13/01/28 15:02 XVPC HOBA/PAKA
         -1 13/01/28 15:02 XVPC HOBA/PAKA <- membername blank
AAGP006O  0 12/11/22 07:44 PBBK HOBA/PAKA
AAGP006S  0 12/07/12 15:13 BLHV HOBA/PAKA


Code'd and aligned

Re: Every record doesn't contain all data

PostPosted: Mon Feb 18, 2013 10:15 pm
by BillyBoyo
Yes, it will be possible.

With WHEN=GROUP you will be able to PUSH the member name to the blank areas.

//S1 EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTIN DD *
RECORD
/*
//SORTOUT DD DUMMY
//SYSIN   DD   *
  OPTION COPY
/*


Can you post the SYSOUT from the above step, please, so we can see what level of the product you have?

Re: Every record doesn't contain all data

PostPosted: Mon Feb 18, 2013 11:52 pm
by skolusu
LasseH,

Assuming you want to build 80 byte control cards, here is a DFSORT JCL which will give you the desired results

//STEP0100 EXEC PGM=SORT                                           
//SYSOUT   DD SYSOUT=*                                             
//SORTIN   DD *                                                   
AAGG002B  0 13/01/22 10:10 SPJH PSTB                               
         -1 13/01/22 10:10 SPJH PSTB                               
AAGP006   0 13/01/28 15:02 XVPC HOBA/PAKA                         
         -1 13/01/28 15:02 XVPC HOBA/PAKA                         
AAGP006O  0 12/11/22 07:44 PBBK HOBA/PAKA                         
AAGP006S  0 12/07/12 15:13 BLHV HOBA/PAKA                         
//SORTOUT  DD SYSOUT=*                                             
//SYSIN    DD *                                                   
  OPTION COPY                                                     
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,8,CH,NE,C' '),
             PUSH=(1:1,8)),   
  IFTHEN=(WHEN=INIT,BUILD=(1,8,SQZ=(SHIFT=LEFT,
          LEAD=C'-EXTRACT ',
      TRAIL=C',ARC=-',LENGTH=25),11,1,80:X)),
  IFTHEN=(WHEN=INIT,OVERLAY=(10:10,70,SQZ=(SHIFT=LEFT)))           
//*


The output of this job is

-EXTRACT AAGG002B,ARC=-0 
-EXTRACT AAGG002B,ARC=-1 
-EXTRACT AAGP006,ARC=-0   
-EXTRACT AAGP006,ARC=-1   
-EXTRACT AAGP006O,ARC=-0 
-EXTRACT AAGP006S,ARC=-0 

Re: Every record doesn't contain all data

PostPosted: Wed Feb 20, 2013 1:06 pm
by LasseH
Thanks Kolusu, work just fine.
Changed a little, cause membername starts in column 2, (8 long) and arclevel starts in column 9, (4 long)

Is it possible to do a decending sort on arclevel within membername?
So that the result will end up like

-EXTRACT DCOLLECT,ARC=-255
-EXTRACT DCOLLECT,ARC=-254
.
.
-EXTRACT DCOLLECT,ARC=0

Running Z/OS DFSORT V1R12

//Lasse

Re: Every record doesn't contain all data

PostPosted: Wed Feb 20, 2013 2:37 pm
by BillyBoyo
Try it out. You have a "free format" number (ie equivalent significant digits are not always in the same place). See if you can find something to sort on which can reflect that.

Re: Every record doesn't contain all data

PostPosted: Wed Feb 20, 2013 10:38 pm
by skolusu
LasseH wrote:Thanks Kolusu, work just fine.
Changed a little, cause membername starts in column 2, (8 long) and arclevel starts in column 9, (4 long)


Hmm, if the member name starts in position 2 and it is 8 bytes long , how come the arc level starts at position 9? Aren't you having overlapping fields?
LasseH wrote:Is it possible to do a decending sort on arclevel within membername?
//Lasse


Do you want to Sort on member name and then the arc level or just arc level irrespective of the member? Either way leave the WHEN=GROUP on the INREC itself, so that you have member name on all the records. Now you can SORT on the data. For arc level sort look up UFF/SFF formats

Move the WHEN=INIT statements to OUTREC which would do build the control cards you need after sorting.