Every record doesn't contain all data



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Every record doesn't contain all data

Postby LasseH » Mon Feb 18, 2013 8:35 pm

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
LasseH
 
Posts: 70
Joined: Mon Nov 08, 2010 2:51 pm
Has thanked: 7 times
Been thanked: 1 time

Re: Every record doesn't contain all data

Postby LasseH » Mon Feb 18, 2013 8:39 pm

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
LasseH
 
Posts: 70
Joined: Mon Nov 08, 2010 2:51 pm
Has thanked: 7 times
Been thanked: 1 time

Re: Every record doesn't contain all data

Postby BillyBoyo » Mon Feb 18, 2013 10:15 pm

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?
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Every record doesn't contain all data

Postby skolusu » Mon Feb 18, 2013 11:52 pm

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 
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
skolusu
 
Posts: 586
Joined: Wed Apr 02, 2008 10:38 pm
Has thanked: 0 time
Been thanked: 39 times

Re: Every record doesn't contain all data

Postby LasseH » Wed Feb 20, 2013 1:06 pm

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
LasseH
 
Posts: 70
Joined: Mon Nov 08, 2010 2:51 pm
Has thanked: 7 times
Been thanked: 1 time

Re: Every record doesn't contain all data

Postby BillyBoyo » Wed Feb 20, 2013 2:37 pm

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.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Every record doesn't contain all data

Postby skolusu » Wed Feb 20, 2013 10:38 pm

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.
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
skolusu
 
Posts: 586
Joined: Wed Apr 02, 2008 10:38 pm
Has thanked: 0 time
Been thanked: 39 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post