MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Append variable number of lines to the correct previous one
Goto page Previous  1, 2, 3  Next
 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12357
Topics: 75
Location: San Jose

PostPosted: Wed May 03, 2017 11:14 am    Post subject: Reply with quote

Fab wrote:

Understood, maybe I have to modify something right now. because when I try your code I get this:
Code:

ICE600I 0 DFSORT ICETOOL UTILITY RUN STARTED                                 
                                                                             
ICE650I 0 VISIT http://www.ibm.com/storage/dfsort FOR ICETOOL PAPERS, EXAMPLES
                                                                             
ICE632I 0 SOURCE FOR ICETOOL STATEMENTS:  TOOLIN                             
                                                                             
                                                                             
ICE630I 0 MODE IN EFFECT:  STOP                                               
                                                                             
            RESIZE FROM(DAF) TO(OUT) -                                       
            TOLEN(00000)                                                     
                  $                                                           
ICE604A 0 ERROR IN KEYWORD, PARAMETER, OR DELIMITER                           
ICE602I 0 OPERATION RETURN CODE:  12                                         
                                                                             
                                                                             
ICE601I 0 DFSORT ICETOOL UTILITY RUN ENDED - RETURN CODE:  12                 


My test input is actually 083221 lines for 1415 pages so probably that is not the problem. Tomorrow I will see how it works Icetool/resize token to solve this error. Thanks for you help & support Kolusu.


Fab,

Looks the multiplication resulted in a number greater than 99999, So it is easy to debug.

1. Remove Step0300 completely.
2. Run step0200 as follows
Code:

//STEP0200 EXEC PGM=SORT                                       
//SYSOUT   DD SYSOUT=*                                         
//SORTIN   DD DSN=&&TMP,DISP=SHR                               
//SORTOUT  DD DSN=DAF.DSNTEP2.dataset,
//            DISP=(NEW,CATLG,DELETE),
//            SPACE=(CYL,(100,25),RLSE)
//SYSIN    DD *                                               
  SORT FIELDS=(144,8,CH,A,                                     
               134,8,CH,A),EQUALS                             
                                                               
  OUTREC OVERLAY=(155:134,8,ZD,MUL,+131,M11,LENGTH=8)   
//*


now max down to the bottom of the dataset and tell me the number from position 134 on wards. It should have 3 numerical values. I need the values from the LAST record.
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Fab
Beginner


Joined: 15 Nov 2016
Posts: 47
Topics: 6

PostPosted: Thu May 04, 2017 2:57 am    Post subject: Reply with quote

Thanks Kolusu,
I run Step0200 as you suggested and values from last record are as follow:
Code:

-+----4----+----5----+----6--
00001411  00000054   00184841


starting column is 134.

After that I did the following change to your STEP0200 code and run again:
Code:

I left this code:
OUTREC OVERLAY=(155:134,8,ZD,MUL,+131,M11,LENGTH=8)

Modified this one (lenght and editing mask)
TRAILER1=(3:'TOLEN(',                   
          MAX=(155,8,ZD,EDIT=(TTTTTTTT)),
          ')')                         

the new execution gave me this:
Code:

ICE600I 0 DFSORT ICETOOL UTILITY RUN STARTED                                 
                                                                             
ICE650I 0 VISIT http://www.ibm.com/storage/dfsort FOR ICETOOL PAPERS, EXAMPLES
                                                                             
ICE632I 0 SOURCE FOR ICETOOL STATEMENTS:  TOOLIN                             
                                                                             
                                                                             
ICE630I 0 MODE IN EFFECT:  STOP                                               
                                                                             
            RESIZE FROM(DAF) TO(OUT) -                                       
            TOLEN(00185103)                                                   
                         $                                                   
ICE604A 0 ERROR IN KEYWORD, PARAMETER, OR DELIMITER                           
ICE602I 0 OPERATION RETURN CODE:  12                                         
                                                                             
                                                                             
ICE601I 0 DFSORT ICETOOL UTILITY RUN ENDED - RETURN CODE:  12                 

I must have missed something
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12357
Topics: 75
Location: San Jose

PostPosted: Thu May 04, 2017 10:14 am    Post subject: Reply with quote

Fab wrote:
Thanks Kolusu,
I run Step0200 as you suggested and values from last record are as follow:
Code:

-+----4----+----5----+----6--
00001411  00000054   00184841


starting column is 134.


Something does not add up. Your value at position 134 should be the number of lines per page which will be merged into a single record. Are you sure you copied the JCL as is?

ok lets debug this issue.

1. Can you find .1 in position 11 in your DSNTEP2 unload file?
2. What do you get when you run this step

Code:

//STEP0100 EXEC PGM=SORT                                       
//SYSOUT   DD SYSOUT=*                                         
//SORTIN   DD DISP=SHR,DSN=Your unload from DSNTEP2 file
//*
//SORTOUT  DD SYSOUT=*
//SYSIN    DD *                                               
  INCLUDE COND=(001,005,CH,EQ,C'1PAGE',OR,                     
                001,133,SS,EQ,C'_|')       


Your sortout should have just the page number records and the actual db2 data. Do you see anything else apart from that?
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
misi01
Advanced


Joined: 02 Dec 2002
Posts: 616
Topics: 171
Location: Stockholm, Sweden

PostPosted: Fri May 05, 2017 4:41 am    Post subject: Reply with quote

Fab - tried to send you a private message so I can e-mail the scripts needed, but couldn't find anything. Please send ME a PM so I can see who I should reply to (if you're interested)
_________________
Michael
Back to top
View user's profile Send private message Send e-mail
Fab
Beginner


Joined: 15 Nov 2016
Posts: 47
Topics: 6

PostPosted: Fri May 05, 2017 8:11 am    Post subject: Reply with quote

thanks Kolusu,
when I run your code as you gave me
Code:

//STEP0100 EXEC PGM=SORT                   
//SYSOUT   DD SYSOUT=*                     
//SORTIN   DD DISP=SHR,DSN=MYUSERID.JOBXSORT
//*                                       
//SORTOUT  DD SYSOUT=*                     
//SYSIN    DD *                           
  INCLUDE COND=(001,005,CH,EQ,C'1PAGE',OR,
                001,133,SS,EQ,C'_!')       

I got this abend
Code:

IEA995I SYMPTOM DUMP OUTPUT  365                                 
  USER COMPLETION CODE=0010                                     
 TIME=14.26.22  SEQ=30920  CPU=0000  ASID=01B7                   
 PSW AT TIME OF ERROR  078D1000   00009524  ILC 2  INTC 0D       
   ACTIVE LOAD MODULE           ADDRESS=00007D00  OFFSET=00001824
   NAME=ICEEXIN                                                 
   DATA AT PSW  0000951E - 41A0C834  0A0D9602  D4159180         
   GR 0: 00000000_00000000   1: 00000000_8000000A               
      2: 00000000_0000000A   3: 00000FFF_000094CE               
      4: 00000000_00000000   5: 00000000_00000000               
      6: 00000000_000188CC   7: 00000000_0000CC2C               
      8: 00000000_00009D00   9: 00000000_4000D024               
      A: 00000000_00009534   B: 00000000_00007D00               
      C: 00000000_00008D00   D: 00000000_00017000               
      E: 00000000_000094CC   F: 00000000_00000010               
 END OF SYMPTOM DUMP                                             
IEF450I MYUSERID0 STEP0100 - ABEND=S000 U0010 REASON=00000000  367

So I modified the code to this:
Code:

//STEP0100 EXEC PGM=SORT                   
//SYSOUT   DD SYSOUT=*                     
//SORTIN   DD DISP=SHR,DSN=MYUSERID.JOBXSORT
//*                                       
//SORTOUT  DD SYSOUT=*                     
//SYSIN    DD *                           
  SORT FIELDS=COPY                         
  INCLUDE COND=(001,005,CH,EQ,C'1PAGE',OR,
                001,133,SS,EQ,C'_!')       
//                                         

and I got this output:
Code:

----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2----+----3----+
         1_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 0576       ! A1B2       ! ESTINTO                !     
         2_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 5355       ! A1B2       ! ESTINTO                !     
         3_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 1500       ! A1A5       ! IN AMMORTAMENTO        !     
         4_! CF                 !              xxxxxx   ! 000000000000xxxxxx ! 0646       ! A1B2       ! IN AMMORTAMENTO        !     
         5_! CF                 !              xxxxxx   ! 000000000000xxxxxx ! 8704       ! A1B2       ! ESTINTO                !     
 1PAGE    3                                                                                                                           
          1_! ESTINZIONE SURROGA PASSIVA                      ! 15.09.2014      !           xxxxxx.020  !             xxxxxxx   !     
          2_! ESTINZIONE SURROGA PASSIVA                      ! 18.09.2014      !           xxxxxx.060  !            xxxxxxxx   !     
          3_! AUTORIZZAZIONE SVINCOLO                         ! 19.09.2014      !           xxxxxx.750  !            xxxxxxxx   !     
          4_! AUTORIZZAZIONE SVINCOLO                         ! 19.09.2014      !           xxxxxx.670  !            xxxxxxxx   !     
          5_! ESTINZIONE SURROGA PASSIVA                      ! 19.09.2014      !           xxxxxx.430  !            xxxxxxxx   !     
 1PAGE    4                                                                     
...
last lines
...
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2----+----3----+
      38063_! AUTORIZZAZIONE SVINCOLO                         ! 23.03.2017      !           xxxxxx.030  !            xxxxxxxx   !     
      38064_! AUTORIZZAZIONE SVINCOLO                         ! 23.03.2017      !           xxxxxx.330  !            xxxxxxxx   !     
      38065_! AUTORIZZAZIONE SVINCOLO                         ! 23.03.2017      !           xxxxxx.240  !            xxxxxxxx   !     
      38066_! AUTORIZZAZIONE SVINCOLO                         ! 23.03.2017      !           xxxxxx.650  !             xxxxxxxx  !     
      38067_! AUTORIZZAZIONE SVINCOLO                         ! 23.03.2017      !           xxxxxx.510  !             xxxxxxxx  !     
      38068_! AUTORIZZAZIONE SVINCOLO                         ! 23.03.2017      !           xxxxxx.500  !             xxxxxxxx  !     
      38069_! AUTORIZZAZIONE SVINCOLO                         ! 23.03.2017      !           xxxxxx.180  !            xxxxxxxx   !     
      38070_! AUTORIZZAZIONE SVINCOLO                         ! 23.03.2017      !           xxxxxx.320  !            xxxxxxxx   !     
      38071_! AUTORIZZAZIONE SVINCOLO                         ! 23.03.2017      !           xxxxxx.190  !             xxxxxxxx  !     
      38072_! AUTORIZZAZIONE SVINCOLO                         ! 23.03.2017      !           xxxxxx.750  !            xxxxxxxx   !     
      38073_! AUTORIZZAZIONE SVINCOLO                         ! 23.03.2017      !           xxxxxx.690  !            xxxxxxxx   !     
      38074_! AUTORIZZAZIONE SVINCOLO                         ! 23.03.2017      !           xxxxxx.940  !            xxxxxxxx   !     
      38075_! AUTORIZZAZIONE SVINCOLO                         ! 23.03.2017      !           xxxxxx.850  !            xxxxxxxx   !     
 1PAGE 1414                                                                                                                           
     38076_! CF                 !             xxxxxxx   ! 000000000001148418 ! 2900       ! A1A5       ! IN AMMORTAMENTO        !     
 1PAGE 1415                                                                                                                           
      38076_! AUTORIZZAZIONE SVINCOLO                         ! 23.03.2017      !           xxxxxx.150  !            xxxxxxxx   !                                                                                                             

and that is my output (masked sensible info) from the 1st line. I don't see anything else apart data that should be there. only difference I see is that input is 134 and output seems to be 135 in lenght.

my input file is like this:
Code:

----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2----+----3----
          +---------------------------------------------------------------------------------------------------------------------     
          !       CD_FNZ       !        FNZ_NEW        !      FNZ_OLD       ! SPORT_SIF  !  PRODOTTO  !       STATO_FNZ        !     
          +---------------------------------------------------------------------------------------------------------------------     
        1_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 0576       ! A1B2       ! ESTINTO                !     
        2_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 5355       ! A1B2       ! ESTINTO                !     
        3_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 1500       ! A1A5       ! IN AMMORTAMENTO        !     
        4_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 0646       ! A1B2       ! IN AMMORTAMENTO        !     
        5_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 8704       ! A1B2       ! ESTINTO                !     
          +---------------------------------------------------------------------------------------------------------------------     
1PAGE    3                                                                                                                           
           --------------------------------------------------------------------------------------------------------------------+     
           !                MOTIVO_STATO_FNZ                 ! DATA_EROGAZIONE !      CAP_EROGATO      !         COPE          !     
           --------------------------------------------------------------------------------------------------------------------+     
         1_! ESTINZIONE SURROGA PASSIVA                      ! 15.09.2014      !           xxxxxx.020  !            xxxxxxxx   !     
         2_! ESTINZIONE SURROGA PASSIVA                      ! 18.09.2014      !           xxxxxx.060  !            xxxxxxxx   !     
         3_! AUTORIZZAZIONE SVINCOLO                         ! 19.09.2014      !           xxxxxx.750  !            xxxxxxxx   !     
         4_! AUTORIZZAZIONE SVINCOLO                         ! 19.09.2014      !           xxxxxx.670  !            xxxxxxxx   !     
         5_! ESTINZIONE SURROGA PASSIVA                      ! 19.09.2014      !           xxxxxx.430  !            xxxxxxxx   !     


I did some editing of sensible infos and I did a bit of a mess, but please note that fields are all aligned.


Last edited by Fab on Fri May 05, 2017 8:22 am; edited 2 times in total
Back to top
View user's profile Send private message
Fab
Beginner


Joined: 15 Nov 2016
Posts: 47
Topics: 6

PostPosted: Fri May 05, 2017 8:20 am    Post subject: Reply with quote

@misi01
PM sent
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12357
Topics: 75
Location: San Jose

PostPosted: Fri May 05, 2017 11:00 am    Post subject: Reply with quote

Fab,

My earlier example was missing the OPTION COPY statement. If you looked at your sysout from the step you would have found the message

Code:

ICE010A 0 NO SORT OR MERGE CONTROL STATEMENT


Either way since you got that resolved, now lets try to fix your error.

You haven't answered my earlier question 1. Can you find .1 in position 11 in your DSNTEP2 unload file?

I believe you know the name of the first column. So do a find for the column name in your DSNTEP2 unload file. I need you to find the 2nd instance and now PF7 a bit and find the '1page'. You should find something like this . Here 22 is an arbitrary page number. In your case it might be something else

Code:

1PAGE   22.1   


May be since you are from Italy, the decimal dot might be configured to be a comma. so you should see
Code:

1PAGE   22,1   


If that is the case then go back and change your DFSORT cards to reflect the value you see.
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Fab
Beginner


Joined: 15 Nov 2016
Posts: 47
Topics: 6

PostPosted: Mon May 08, 2017 4:28 am    Post subject: Reply with quote

Thanks Kolusu,
Code:

You haven't answered my earlier question 1. Can you find .1 in position 11 in your DSNTEP2 unload file?

No, in my input there are not '1.' char in position 11. This is my input since the very beginning, I did not alter anything (except for sensible infos substituted with xxxxx). This is the very beginning of input file:
Code:

----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2----+----3----
********************************* Top of Data ***************************************** Top of Data **********************************
                                                                                     
          +---------------------------------------------------------------------------------------------------------------------     
          !       CD_FNZ       !        FNZ_NEW        !      FNZ_OLD       ! SPORT_SIF  !  PRODOTTO  !       STATO_FNZ        !     
          +---------------------------------------------------------------------------------------------------------------------     
        1_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 0576       ! A1B2       ! ESTINTO                !     
        2_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 5355       ! A1B2       ! ESTINTO                !     
        3_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 1500       ! A1A5       ! IN AMMORTAMENTO        !     
        4_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 0646       ! A1B2       ! IN AMMORTAMENTO        !     
        5_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 8704       ! A1B2       ! ESTINTO                !     
          +---------------------------------------------------------------------------------------------------------------------     
1PAGE    3                                                                                                                           
           --------------------------------------------------------------------------------------------------------------------+     
           !                MOTIVO_STATO_FNZ                 ! DATA_EROGAZIONE !      CAP_EROGATO      !         COPE          !     
           --------------------------------------------------------------------------------------------------------------------+     
         1_! ESTINZIONE SURROGA PASSIVA                      ! 15.09.2014      !           xxxxxx.020  !            xxxxxxxx   !     
         2_! ESTINZIONE SURROGA PASSIVA                      ! 18.09.2014      !           xxxxxx.060  !            xxxxxxxx   !     
         3_! AUTORIZZAZIONE SVINCOLO                         ! 19.09.2014      !           xxxxxx.750  !            xxxxxxxx   !     
         4_! AUTORIZZAZIONE SVINCOLO                         ! 19.09.2014      !           xxxxxx.670  !            xxxxxxxx   !     
         5_! ESTINZIONE SURROGA PASSIVA                      ! 19.09.2014      !           xxxxxx.430  !            xxxxxxxx   ! 


And this is the end
Code:

----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2----+----3----
     38072_! AUTORIZZAZIONE SVINCOLO                         ! 23.03.2017      !            xxxxx.750  !            xxxxxxxx   !     
     38073_! AUTORIZZAZIONE SVINCOLO                         ! 23.03.2017      !            xxxxx.690  !            xxxxxxxx   !     
     38074_! AUTORIZZAZIONE SVINCOLO                         ! 23.03.2017      !            xxxxx.940  !            xxxxxxxx   !     
     38075_! AUTORIZZAZIONE SVINCOLO                         ! 23.03.2017      !            xxxxx.850  !            xxxxxxxx   !     
           --------------------------------------------------------------------------------------------------------------------+     
1PAGE 1414                                                                                                                           
          +---------------------------------------------------------------------------------------------------------------------     
          !       CD_FNZ       !        FNZ_NEW        !      FNZ_OLD       ! SPORT_SIF  !  PRODOTTO  !       STATO_FNZ        !     
          +---------------------------------------------------------------------------------------------------------------------     
    38076_! CF                 !             xxxxxxx   ! 00000000000xxxxxxx ! 2900       ! A1A5       ! IN AMMORTAMENTO        !     
          +---------------------------------------------------------------------------------------------------------------------     
1PAGE 1415                                                                                                                           
           --------------------------------------------------------------------------------------------------------------------+     
           !                MOTIVO_STATO_FNZ                 ! DATA_EROGAZIONE !      CAP_EROGATO      !         COPE          !     
           --------------------------------------------------------------------------------------------------------------------+     
     38076_! AUTORIZZAZIONE SVINCOLO                         ! 23.03.2017      !           xxxxxx.150  !            xxxxxxxx   !     
           --------------------------------------------------------------------------------------------------------------------+     
******************************** Bottom of Data ************************************** Bottom of Data ********************************

as you can see in position 11 I may have + ! blank or _. I'm sorry I did not answer you before. You can see that 1PAGE is followed by a number (and in my case it start with 3), followed by a blank.

Thanks again.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12357
Topics: 75
Location: San Jose

PostPosted: Mon May 08, 2017 11:03 am    Post subject: Reply with quote

Fab,


You really need to pay attention to the questions I asked. I wanted to know where your dsntep2 started over once again with column 1 data.

So lets start once again.

1. What is the Name of your FIRST Db2 column name in your output?
2. Grab that name and then do a FIND for it in the DSNTEP2 output. The first time you see it will have 1 PAGE 1 and then I want you to repeat find the 2nd time you have that column. Now tell me what is the page number for that.
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Fab
Beginner


Joined: 15 Nov 2016
Posts: 47
Topics: 6

PostPosted: Tue May 09, 2017 2:45 am    Post subject: Reply with quote

Thanks Kolusu, I'm doing my best,
I am assuming you are trying to understand 1PAGE xx increment sequence, so my answers are following this assumption. I hope I am not completely misundertanding you.
Code:
1. What is the Name of your FIRST Db2 column name in your output?


Considering that what I did is:
1) make a DB2 query on the base of a customer request
2) put that query in a partitioned dataset
3) execute a tool (it's called Uptown/MP) that take that partitioned and execute query instructions located in there to produce the output I reported here above (which would be the input to your sort).

That said I guess you can only talk about my query or about the tool's output, both cases the answer to your question is CD_FNZ.

Code:
2. Grab that name and then do a FIND for it in the DSNTEP2 output. The first time you see it will have 1 PAGE 1 and then I want you to repeat find the 2nd time you have that column. Now tell me what is the page number for that.

I am assuming that DSNTEP2 is the tool into the JCL created/invoked by Uptown/MP correct? If that's correct it's output is the input to your sort (and what I've already quote in my previous post). If so the FIRST time I search for CD_FNZ I found this
Code:
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
1PAGE    3                                                                     
not 1PAGE 1.

The 2nd time I repeat search I found this:
Code:
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
1PAGE    4


Again I hope I understood you. Thanks.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12357
Topics: 75
Location: San Jose

PostPosted: Tue May 09, 2017 3:36 pm    Post subject: Reply with quote

Fab,

Hmm I don't know how to help you. I cannot see your data and I am not sure as to where the pages are reset and the first column data starts over.

Lets try something different. We will work off the first column and see if we can arrive at a solution.

Run this step ( may be run with 10 instances of CD_FNZ to begin with)

Code:

//STEP0100 EXEC PGM=SORT                                       
//SYSOUT   DD SYSOUT=*                                         
//SORTIN   DD DISP=SHR,DSN=Your.unload           
//SORTOUT  DD SYSOUT=*
//SYSIN    DD *                                                 
  INCLUDE COND=(001,005,CH,EQ,C'1PAGE',OR,                     
                001,133,SS,EQ,C'_!',OR,                         
                001,133,SS,EQ,C'CD_FNZ')                       
                                                               
  INREC IFOUTLEN=142,                                           
        IFTHEN=(WHEN=GROUP,BEGIN=(001,5,CH,EQ,C'1PAGE'),       
          PUSH=(134:ID=8)),                                     
        IFTHEN=(WHEN=GROUP,BEGIN=(001,133,SS,EQ,C'CD_FNZ',AND, 
                                  134,008,ZD,GT,1),             
          PUSH=(143:134,8)),                                   
        IFTHEN=(WHEN=(143,1,CH,GT,C' '),                       
       OVERLAY=(134:(134,8,ZD,SUB,143,8,ZD),ADD,+1,             
                     M11,LENGTH=8))                             
                                                               
  SORT FIELDS=(134,8,ZD,A),EQUALS                               
                                                               
  OUTFIL OMIT=(001,005,CH,EQ,C'1PAGE',OR,                       
                001,133,SS,EQ,C'CD_FNZ'),                       
  OVERLAY=(144:SEQNUM,8,ZD,RESTART=(134,8))                     
                                                               
//*                                                             


Now go look at the contents of position 134 and 144 and make sure that you see that page ID at 134 being reset every time and the position 144 has a number less than 250.

Once you got that working correctly then run my step0200 and step0300 and you should get the desired results.
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Fab
Beginner


Joined: 15 Nov 2016
Posts: 47
Topics: 6

PostPosted: Wed May 10, 2017 7:23 am    Post subject: Reply with quote

Thanks Kolusu,
Code:

I cannot see your data and I am not sure as to where the pages are reset and the first column data starts over.

As far as I can see I cannot attach files here, so I will try to show you a reasonable amount of my input hoping it is enough for you to fully understand the correct sequence. These are the first 6 pages, I have not erased anything, this is exactly what I have from the beginning of the input file. I have just masked sensible infos.
Code:

----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2----+----3----
          +---------------------------------------------------------------------------------------------------------------------     
          !       CD_FNZ       !        FNZ_NEW        !      FNZ_OLD       ! SPORT_SIF  !  PRODOTTO  !       STATO_FNZ        !     
          +---------------------------------------------------------------------------------------------------------------------     
        1_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 0576       ! A1B2       ! ESTINTO                !     
        2_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 5355       ! A1B2       ! ESTINTO                !     
        3_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 1500       ! A1A5       ! IN AMMORTAMENTO        !     
        4_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 0646       ! A1B2       ! IN AMMORTAMENTO        !     
        5_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 8704       ! A1B2       ! ESTINTO                !     
          +---------------------------------------------------------------------------------------------------------------------     
1PAGE    3                                                                                                                           
           --------------------------------------------------------------------------------------------------------------------+     
           !                MOTIVO_STATO_FNZ                 ! DATA_EROGAZIONE !      CAP_EROGATO      !         COPE          !     
           --------------------------------------------------------------------------------------------------------------------+     
         1_! ESTINZIONE SURROGA PASSIVA                      ! 15.09.2014      !           xxxxxx.020  !            xxxxxxxx   !     
         2_! ESTINZIONE SURROGA PASSIVA                      ! 18.09.2014      !           xxxxxx.060  !            xxxxxxxx   !     
         3_! AUTORIZZAZIONE SVINCOLO                         ! 19.09.2014      !           xxxxxx.750  !            xxxxxxxx   !     
         4_! AUTORIZZAZIONE SVINCOLO                         ! 19.09.2014      !           xxxxxx.670  !            xxxxxxxx   !     
         5_! ESTINZIONE SURROGA PASSIVA                      ! 19.09.2014      !           xxxxxx.430  !            xxxxxxxx   !     
           --------------------------------------------------------------------------------------------------------------------+
1PAGE    4                                                                                                                     
          +---------------------------------------------------------------------------------------------------------------------
          !       CD_FNZ       !        FNZ_NEW        !      FNZ_OLD       ! SPORT_SIF  !  PRODOTTO  !       STATO_FNZ        !
          +---------------------------------------------------------------------------------------------------------------------
        6_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 0642       ! A1B2       ! ESTINTO                !
        7_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 4803       ! A1B2       ! ESTINTO                !
        8_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 1746       ! A1A5       ! IN AMMORTAMENTO        !
        9_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 7100       ! A1B2       ! ESTINTO                !
       10_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 8100       ! A1B2       ! IN AMMORTAMENTO        !
       11_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 2943       ! A1B2       ! IN AMMORTAMENTO        !
       12_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 2143       ! A1A5       ! ESTINTO                !
       13_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 4378       ! A1B2       ! IN AMMORTAMENTO        !
       14_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 3343       ! A1B2       ! IN AMMORTAMENTO        !
       15_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 3000       ! A1B2       ! ESTINTO                !
       16_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 6326       ! A1B2       ! IN AMMORTAMENTO        !
       17_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 4146       ! A1B2       ! IN AMMORTAMENTO        !
       18_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 8400       ! A1B14      ! ESTINTO                !
       19_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 8143       ! A1B2       ! ESTINTO                !
       20_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 5500       ! A1B2       ! IN AMMORTAMENTO        !
       21_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 2101       ! A1B2       ! IN AMMORTAMENTO        !
       22_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 1500       ! A1B2       ! IN AMMORTAMENTO        !
       23_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 4368       ! A1B2       ! IN AMMORTAMENTO        !
       24_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 8400       ! A1B14      ! IN AMMORTAMENTO        !
       25_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 6312       ! A1B2       ! IN AMMORTAMENTO        !
       26_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 6312       ! A1B2       ! IN AMMORTAMENTO        !
       27_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 7023       ! A1B2       ! ESTINTO                !
       28_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 0907       ! A1B2       ! ESTINTO                !
       29_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 2850       ! A1B2       ! IN AMMORTAMENTO        !
       30_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 4309       ! A1B2       ! IN AMMORTAMENTO        !
       31_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 0743       ! A1B14      ! IN AMMORTAMENTO        !
       32_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 7077       ! A1B2       ! IN AMMORTAMENTO        !
       33_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 4243       ! A1B2       ! IN AMMORTAMENTO        !
       34_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 1846       ! A1B2       ! IN AMMORTAMENTO        !
       35_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 4361       ! A1B2       ! ESTINTO                !
       36_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 2849       ! A1B2       ! IN AMMORTAMENTO        !
       37_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 7744       ! A1B2       ! IN AMMORTAMENTO        !
       38_! CF                 !             xxxxxxx   ! 000000002358xxxxxx ! 5400       ! A1B2       ! IN AMMORTAMENTO        !
       39_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 6002       ! A1B2       ! IN AMMORTAMENTO        !
       40_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 4701       ! A1B2       ! ESTINTO                !
       41_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 1500       ! A1B2       ! ESTINTO                !
       42_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 7044       ! A1B2       ! IN AMMORTAMENTO        !
       43_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 2803       ! A1B2       ! IN AMMORTAMENTO        !
       44_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 3952       ! A1B2       ! ESTINTO                !
       45_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 6490       ! A1B2       ! ESTINTO                !
       46_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 6439       ! A1B2       ! IN AMMORTAMENTO        !
       47_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 4707       ! A1B2       ! IN AMMORTAMENTO        !
       48_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 0507       ! A1A5       ! ESTINTO                !
       49_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 5843       ! A1A5       ! ESTINTO                !
       50_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 0564       ! A1A5       ! ESTINTO                !
       51_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 5101       ! A1B2       ! ESTINTO                !
       52_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 1244       ! A1B11      ! ESTINTO                !
       53_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 6319       ! A1A5       ! ESTINTO                !
       54_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 0904       ! A1B2       ! ESTINTO                !
       55_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 0546       ! A1A5       ! ESTINTO                !
       56_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 3702       ! A1A5       ! IN AMMORTAMENTO        !
       57_! CF                 !             xxxxxxx   ! 000000000001xxxxxx ! 4360       ! A1B2       ! ESTINTO                !
       58_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 0567       ! A1B2       ! IN AMMORTAMENTO        !
       59_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 0949       ! A1A5       ! ESTINTO                !
          +---------------------------------------------------------------------------------------------------------------------
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2----+----3----
1PAGE    5                                                                                                                     
           --------------------------------------------------------------------------------------------------------------------+
           !                MOTIVO_STATO_FNZ                 ! DATA_EROGAZIONE !      CAP_EROGATO      !         COPE          !
           --------------------------------------------------------------------------------------------------------------------+
         6_! ESTINZIONE SURROGA PASSIVA                      ! 22.09.2014      !           xxxxxx.290  !            xxxxxxxx   !
         7_! ESTINZIONE ANTICIPATA                           ! 22.09.2014      !           xxxxxx.330  !            xxxxxxxx   !
         8_! AUTORIZZAZIONE SVINCOLO                         ! 22.09.2014      !           xxxxxx.670  !            xxxxxxxx   !
         9_! ESTINZIONE ANTICIPATA                           ! 23.09.2014      !           xxxxxx.150  !            xxxxxxxx   !
        10_! AUTORIZZAZIONE SVINCOLO                         ! 23.09.2014      !           xxxxxx.600  !            xxxxxxxx   !
        11_! AUTORIZZAZIONE SVINCOLO                         ! 03.10.2014      !           xxxxxx.120  !            xxxxxxxx   !
        12_! ESTINZIONE ANTICIPATA                           ! 03.10.2014      !           xxxxxx.380  !            xxxxxxxx   !
        13_! AUTORIZZAZIONE SVINCOLO                         ! 06.10.2014      !           xxxxxx.570  !            xxxxxxxx   !
        14_! AUTORIZZAZIONE SVINCOLO                         ! 07.10.2014      !           xxxxxx.470  !            xxxxxxxx   !
        15_! ESTINZIONE ANTICIPATA                           ! 07.10.2014      !           xxxxxx.080  !            xxxxxxxx   !
        16_! AUTORIZZAZIONE SVINCOLO                         ! 08.10.2014      !           xxxxxx.200  !            xxxxxxxx   !
        17_! AUTORIZZAZIONE SVINCOLO                         ! 08.10.2014      !           xxxxxx.610  !            xxxxxxxx   !
        18_! ESTINZIONE ANTICIPATA                           ! 09.10.2014      !           xxxxxx.060  !            xxxxxxxx   !
        19_! ESTINZIONE ANTICIPATA                           ! 09.10.2014      !           xxxxxx.420  !            xxxxxxxx   !
        20_! AUTORIZZAZIONE SVINCOLO                         ! 09.10.2014      !           xxxxxx.810  !            xxxxxxxx   !
        21_! AUTORIZZAZIONE SVINCOLO                         ! 10.10.2014      !           xxxxxx.290  !            xxxxxxxx   !
        22_! AUTORIZZAZIONE SVINCOLO                         ! 10.10.2014      !           xxxxxx.000  !            xxxxxxxx   !
        23_! AUTORIZZAZIONE SVINCOLO                         ! 10.10.2014      !           xxxxxx.630  !            xxxxxxxx   !
        24_! AUTORIZZAZIONE SVINCOLO                         ! 10.10.2014      !           xxxxxx.890  !            xxxxxxxx   !
        25_! AUTORIZZAZIONE SVINCOLO                         ! 10.10.2014      !           xxxxxx.930  !            xxxxxxxx   !
        26_! AUTORIZZAZIONE SVINCOLO                         ! 10.10.2014      !           xxxxxx.790  !            xxxxxxxx   !
        27_! ESTINZIONE ANTICIPATA                           ! 10.10.2014      !           xxxxxx.930  !            xxxxxxxx   !
        28_! ESTINZIONE ANTICIPATA                           ! 13.10.2014      !           xxxxxx.720  !            xxxxxxxx   !
        29_! AUTORIZZAZIONE SVINCOLO                         ! 15.10.2014      !           xxxxxx.440  !            xxxxxxxx   !
        30_! AUTORIZZAZIONE SVINCOLO                         ! 15.10.2014      !           xxxxxx.400  !            xxxxxxxx   !
        31_! AUTORIZZAZIONE SVINCOLO                         ! 16.10.2014      !           xxxxxx.040  !            xxxxxxxx   !
        32_! AUTORIZZAZIONE SVINCOLO                         ! 16.10.2014      !           xxxxxx.790  !            xxxxxxxx   !
        33_! AUTORIZZAZIONE SVINCOLO                         ! 17.10.2014      !           xxxxxx.230  !            xxxxxxxx   !
        34_! AUTORIZZAZIONE SVINCOLO                         ! 17.10.2014      !           xxxxxx.960  !            xxxxxxxx   !
        35_! ESTINZIONE SURROGA PASSIVA                      ! 20.10.2014      !           xxxxxx.290  !            xxxxxxxx   !
        36_! AUTORIZZAZIONE SVINCOLO                         ! 20.10.2014      !           xxxxxx.960  !            xxxxxxxx   !
        37_! AUTORIZZAZIONE SVINCOLO                         ! 21.10.2014      !           xxxxxx.680  !            xxxxxxxx   !
        38_! AUTORIZZAZIONE SVINCOLO                         ! 22.10.2014      !           xxxxxx.370  !            xxxxxxxx   !
        39_! AUTORIZZAZIONE SVINCOLO                         ! 22.10.2014      !           xxxxxx.870  !            xxxxxxxx   !
        40_! ESTINZIONE ANTICIPATA                           ! 23.10.2014      !           xxxxxx.110  !            xxxxxxxx   !
        41_! ESTINZIONE SURROGA PASSIVA                      ! 23.10.2014      !           xxxxxx.560  !            xxxxxxxx   !
        42_! AUTORIZZAZIONE SVINCOLO                         ! 23.10.2014      !           xxxxxx.140  !            xxxxxxxx   !
        43_! AUTORIZZAZIONE SVINCOLO                         ! 23.10.2014      !           xxxxxx.790  !            xxxxxxxx   !
        44_! ESTINZIONE ANTICIPATA                           ! 03.11.2014      !           xxxxxx.110  !            xxxxxxxx   !
        45_! ESTINZIONE ANTICIPATA                           ! 03.11.2014      !           xxxxxx.890  !            xxxxxxxx   !
        46_! AUTORIZZAZIONE SVINCOLO                         ! 04.11.2014      !           xxxxxx.000  !            xxxxxxxx   !
        47_! AUTORIZZAZIONE SVINCOLO                         ! 04.11.2014      !           xxxxxx.670  !            xxxxxxxx   !
        48_! ESTINZIONE SURROGA PASSIVA                      ! 05.11.2014      !           xxxxxx.770  !            xxxxxxxx   !
        49_! ESTINZIONE ANTICIPATA                           ! 05.11.2014      !           xxxxxx.970  !            xxxxxxxx   !
        50_! ESTINZIONE ANTICIPATA                           ! 05.11.2014      !           xxxxxx.880  !            xxxxxxxx   !
        51_! ESTINZIONE ANTICIPATA                           ! 05.11.2014      !           xxxxxx.320  !            xxxxxxxx   !
        52_! ESTINZIONE ANTICIPATA                           ! 06.11.2014      !           xxxxxx.690  !            xxxxxxxx   !
        53_! ESTINZIONE ANTICIPATA                           ! 06.11.2014      !           xxxxxx.210  !            xxxxxxxx   !
        54_! ESTINZIONE ANTICIPATA                           ! 06.11.2014      !           xxxxxx.690  !            xxxxxxxx   !
        55_! ESTINZIONE ANTICIPATA                           ! 06.11.2014      !           xxxxxx.400  !            xxxxxxxx   !
        56_! AUTORIZZAZIONE SVINCOLO                         ! 06.11.2014      !           xxxxxx.360  !            xxxxxxxx   !
        57_! ESTINZIONE SURROGA PASSIVA                      ! 07.11.2014      !           xxxxxx.540  !            xxxxxxxx   !
        58_! AUTORIZZAZIONE SVINCOLO                         ! 07.11.2014      !           xxxxxx.440  !            xxxxxxxx   !
        59_! ESTINZIONE ANTICIPATA                           ! 07.11.2014      !           xxxxxx.420  !            xxxxxxxx   !
           --------------------------------------------------------------------------------------------------------------------+
1PAGE    6                                                                                                                     
          +---------------------------------------------------------------------------------------------------------------------
          !       CD_FNZ       !        FNZ_NEW        !      FNZ_OLD       ! SPORT_SIF  !  PRODOTTO  !       STATO_FNZ        !
          +---------------------------------------------------------------------------------------------------------------------
       60_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 0103       ! A1B5       ! ESTINTO                !
       61_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 3313       ! A1A5       ! ESTINTO                !
       62_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 6800       ! A1B2       ! ESTINTO                !
       63_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 0644       ! A1B2       ! ESTINTO                !
       64_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 4143       ! A1B2       ! ESTINTO                !
       65_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 4305       ! A1B2       ! ESTINTO                !
       66_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 4320       ! A1B2       ! ESTINTO                !
       67_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 4325       ! A1B2       ! IN AMMORTAMENTO        !
       68_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 0975       ! A1A5       ! ESTINTO                !
       69_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 4565       ! A1B2       ! ESTINTO                !
       70_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 4246       ! A1B2       ! IN AMMORTAMENTO        !
       71_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 6002       ! A1A5       ! IN AMMORTAMENTO        !
       72_! CF                 !             xxxxxxx   ! 000000002424xxxxxx ! 6439       ! A1A5       ! IN AMMORTAMENTO        !
       73_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 7502       ! A1A5       ! ESTINTO                !
       74_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 0507       ! A1B2       ! ESTINTO                !
       75_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 6555       ! A1A5       ! ESTINTO                !
       76_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 0546       ! A1A5       ! ESTINTO                !
       77_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 4200       ! A1B2       ! IN AMMORTAMENTO        !
       78_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 7013       ! A1A5       ! IN AMMORTAMENTO        !
       79_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 6373       ! A1A5       ! ESTINTO                !
       80_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 0500       ! A1A5       ! ESTINTO                !
       81_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 3052       ! A1A5       ! ESTINTO                !
       82_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 0644       ! A1B2       ! IN AMMORTAMENTO        !
       83_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 1700       ! A1B2       ! ESTINTO                !
       84_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 0508       ! A1B14      ! ESTINTO                !
       85_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 0100       ! A1A5       ! ESTINTO                !
       86_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 0576       ! A1B2       ! ESTINTO                !
       87_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 3000       ! A1B14      ! IN AMMORTAMENTO        !
       88_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 3343       ! A1B2       ! IN AMMORTAMENTO        !
       89_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 2449       ! A1A5       ! ESTINTO                !
       90_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 4320       ! A1B2       ! ESTINTO                !
       91_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 4500       ! A1B2       ! IN AMMORTAMENTO        !
       92_! CF                 !             xxxxxxx   ! 000000000001xxxxxx ! 6477       ! A1B2       ! ESTINTO                !
       93_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 8401       ! A1B2       ! ESTINTO                !
       94_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 0600       ! A1B2       ! IN AMMORTAMENTO        !
       95_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 4320       ! A1B2       ! ESTINTO                !
       96_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 8401       ! A1B2       ! ESTINTO                !
       97_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 3377       ! A1B2       ! IN AMMORTAMENTO        !
       98_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 5000       ! A1B2       ! IN AMMORTAMENTO        !
       99_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 3949       ! A1B2       ! IN AMMORTAMENTO        !
      100_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 8405       ! A1B2       ! IN AMMORTAMENTO        !
      101_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 0576       ! A1B2       ! IN AMMORTAMENTO        !
      102_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 6330       ! A1A5       ! ESTINTO                !
      103_! CF                 !             xxxxxxx   ! 000000000001xxxxxx ! 7058       ! A1A5       ! ESTINTO                !
      104_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 7077       ! A1B2       ! IN AMMORTAMENTO        !
      105_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 4300       ! A1B2       ! ESTINTO                !
      106_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 0500       ! A1B5       ! IN AMMORTAMENTO        !
      107_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 4313       ! A1B2       ! IN AMMORTAMENTO        !
      108_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 6800       ! A1A5       ! ESTINTO                !
      109_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 6350       ! A1B2       ! IN AMMORTAMENTO        !
      110_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 0543       ! A1A5       ! ESTINTO                !
      111_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 6308       ! A1B2       ! IN AMMORTAMENTO        !
      112_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 3843       ! A1B2       ! IN AMMORTAMENTO        !
      113_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 2801       ! A1B2       ! ESTINTO                !
          +---------------------------------------------------------------------------------------------------------------------
1PAGE    7                                                                                                                     
           --------------------------------------------------------------------------------------------------------------------+
           !                MOTIVO_STATO_FNZ                 ! DATA_EROGAZIONE !      CAP_EROGATO      !         COPE          !
           --------------------------------------------------------------------------------------------------------------------+
        60_! ESTINZIONE SURROGA PASSIVA                      ! 07.11.2014      !           xxxxxx.160  !            xxxxxxxx   !
        61_! ESTINZIONE SURROGA PASSIVA                      ! 07.11.2014      !           xxxxxx.900  !            xxxxxxxx   !
        62_! ESTINZIONE ANTICIPATA                           ! 07.11.2014      !           xxxxxx.660  !            xxxxxxxx   !
        63_! ESTINZIONE SURROGA PASSIVA                      ! 07.11.2014      !           xxxxxx.780  !            xxxxxxxx   !
        64_! ESTINZIONE ANTICIPATA                           ! 10.11.2014      !           xxxxxx.550  !            xxxxxxxx   !
        65_! ESTINZIONE ANTICIPATA                           ! 10.11.2014      !           xxxxxx.710  !            xxxxxxxx   !
        66_! ESTINZIONE SURROGA PASSIVA                      ! 10.11.2014      !           xxxxxx.900  !            xxxxxxxx   !
        67_! AUTORIZZAZIONE SVINCOLO                         ! 12.11.2014      !           xxxxxx.220  !            xxxxxxxx   !
        68_! ESTINZIONE ANTICIPATA                           ! 12.11.2014      !           xxxxxx.390  !            xxxxxxxx   !
        69_! ESTINZIONE SURROGA PASSIVA                      ! 12.11.2014      !           xxxxxx.780  !            xxxxxxxx   !
        70_! AUTORIZZAZIONE SVINCOLO                         ! 12.11.2014      !           xxxxxx.230  !            xxxxxxxx   !
        71_! AUTORIZZAZIONE SVINCOLO                         ! 12.11.2014      !           xxxxxx.030  !            xxxxxxxx   !
        72_! AUTORIZZAZIONE SVINCOLO                         ! 13.11.2014      !           xxxxxx.280  !            xxxxxxxx   !
        73_! ESTINZIONE ANTICIPATA                           ! 13.11.2014      !           xxxxxx.840  !            xxxxxxxx   !
        74_! ESTINZIONE ANTICIPATA                           ! 13.11.2014      !           xxxxxx.870  !            xxxxxxxx   !
        75_! ESTINZIONE ANTICIPATA                           ! 13.11.2014      !           xxxxxx.910  !            xxxxxxxx   !
        76_! ESTINZIONE ANTICIPATA                           ! 13.11.2014      !           xxxxxx.640  !            xxxxxxxx   !
        77_! AUTORIZZAZIONE SVINCOLO                         ! 13.11.2014      !           xxxxxx.920  !            xxxxxxxx   !
        78_! AUTORIZZAZIONE SVINCOLO                         ! 13.11.2014      !           xxxxxx.930  !            xxxxxxxx   !
        79_! ESTINZIONE ANTICIPATA                           ! 13.11.2014      !           xxxxxx.110  !            xxxxxxxx   !
        80_! ESTINZIONE SURROGA PASSIVA                      ! 14.11.2014      !           xxxxxx.720  !            xxxxxxxx   !
        81_! ESTINZIONE ANTICIPATA                           ! 14.11.2014      !           xxxxxx.590  !            xxxxxxxx   !
        82_! AUTORIZZAZIONE SVINCOLO                         ! 14.11.2014      !           xxxxxx.910  !            xxxxxxxx   !
        83_! ESTINZIONE ANTICIPATA                           ! 14.11.2014      !           xxxxxx.300  !            xxxxxxxx   !
        84_! ESTINZIONE ANTICIPATA                           ! 14.11.2014      !           xxxxxx.010  !            xxxxxxxx   !
        85_! ESTINZIONE SURROGA PASSIVA                      ! 14.11.2014      !           xxxxxx.940  !            xxxxxxxx   !
        86_! ESTINZIONE ANTICIPATA                           ! 14.11.2014      !           xxxxxx.750  !            xxxxxxxx   !
        87_! AUTORIZZAZIONE SVINCOLO                         ! 17.11.2014      !           xxxxxx.630  !            xxxxxxxx   !
        88_! AUTORIZZAZIONE SVINCOLO                         ! 17.11.2014      !           xxxxxx.510  !            xxxxxxxx   !
        89_! ESTINZIONE ANTICIPATA                           ! 17.11.2014      !           xxxxxx.300  !            xxxxxxxx   !
        90_! ESTINZIONE ANTICIPATA                           ! 17.11.2014      !           xxxxxx.420  !            xxxxxxxx   !
        91_! AUTORIZZAZIONE SVINCOLO                         ! 17.11.2014      !           xxxxxx.780  !            xxxxxxxx   !
        92_! ESTINZIONE SURROGA PASSIVA                      ! 17.11.2014      !           xxxxxx.590  !            xxxxxxxx   !
        93_! ESTINZIONE SURROGA PASSIVA                      ! 17.11.2014      !           xxxxxx.590  !            xxxxxxxx   !
        94_! AUTORIZZAZIONE SVINCOLO                         ! 17.11.2014      !           xxxxxx.970  !            xxxxxxxx   !
        95_! ESTINZIONE ANTICIPATA                           ! 17.11.2014      !           xxxxxx.810  !            xxxxxxxx   !
        96_! ESTINZIONE SURROGA PASSIVA                      ! 18.11.2014      !           xxxxxx.920  !            xxxxxxxx   !
        97_! AUTORIZZAZIONE SVINCOLO                         ! 18.11.2014      !           xxxxxx.110  !            xxxxxxxx   !
        98_! AUTORIZZAZIONE SVINCOLO                         ! 18.11.2014      !           xxxxxx.850  !            xxxxxxxx   !
        99_! AUTORIZZAZIONE SVINCOLO                         ! 18.11.2014      !           xxxxxx.420  !            xxxxxxxx   !
       100_! AUTORIZZAZIONE SVINCOLO                         ! 18.11.2014      !           xxxxxx.170  !            xxxxxxxx   !
       101_! AUTORIZZAZIONE SVINCOLO                         ! 18.11.2014      !           xxxxxx.270  !            xxxxxxxx   !
       102_! ESTINZIONE SURROGA PASSIVA                      ! 19.11.2014      !           xxxxxx.570  !            xxxxxxxx   !
       103_! ESTINZIONE SURROGA PASSIVA                      ! 19.11.2014      !           xxxxxx.620  !            xxxxxxxx   !
       104_! AUTORIZZAZIONE SVINCOLO                         ! 19.11.2014      !           xxxxxx.930  !            xxxxxxxx   !
       105_! ESTINZIONE ANTICIPATA                           ! 19.11.2014      !           xxxxxx.590  !            xxxxxxxx   !
       106_! AUTORIZZAZIONE SVINCOLO                         ! 20.11.2014      !           xxxxxx.450  !            xxxxxxxx   !
       107_! AUTORIZZAZIONE SVINCOLO                         ! 21.11.2014      !           xxxxxx.890  !            xxxxxxxx   !
       108_! ESTINZIONE ANTICIPATA                           ! 21.11.2014      !           xxxxxx.370  !            xxxxxxxx   !
       109_! AUTORIZZAZIONE SVINCOLO                         ! 21.11.2014      !           xxxxxx.910  !            xxxxxxxx   !
       110_! ESTINZIONE SURROGA PASSIVA                      ! 21.11.2014      !           xxxxxx.360  !            xxxxxxxx   !
       111_! AUTORIZZAZIONE SVINCOLO                         ! 21.11.2014      !           xxxxxx.530  !            xxxxxxxx   !
       112_! AUTORIZZAZIONE SVINCOLO                         ! 21.11.2014      !           xxxxxx.940  !            xxxxxxxx   !
       113_! ESTINZIONE ANTICIPATA                           ! 21.11.2014      !           xxxxxx.210  !            xxxxxxxx   !
           --------------------------------------------------------------------------------------------------------------------+
1PAGE    8                                                                                                                     
          +---------------------------------------------------------------------------------------------------------------------
          !       CD_FNZ       !        FNZ_NEW        !      FNZ_OLD       ! SPORT_SIF  !  PRODOTTO  !       STATO_FNZ        !
          +---------------------------------------------------------------------------------------------------------------------
      114_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 4352       ! A1B2       ! IN AMMORTAMENTO        !
      115_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 3946       ! A1B2       ! ESTINTO                !
      116_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 7014       ! A1A5       ! ESTINTO                !
      117_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 8401       ! A1B2       ! IN AMMORTAMENTO        !
      118_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 3300       ! A1B2       ! ESTINTO                !
      119_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 4321       ! A1A5       ! ESTINTO                !
      120_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 6330       ! A1B2       ! IN AMMORTAMENTO        !
      121_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 6411       ! A1B2       ! ESTINTO                !
      122_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 6330       ! A1B2       ! ESTINTO                !
      123_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 1846       ! A1A5       ! IN AMMORTAMENTO        !
      124_! CF                 !             xxxxxxx   ! 000000000000xxxxxx ! 6652       ! A1B2       ! IN AMMORTAMENTO        !


These COLS lines obviously are not part of the file:
Code:
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2----+----3----

If you need I can upload the entire file somewhere and send you the link, so you can see the full input.

Now let's talk about your new sort, I have executed exactly this:
Code:

//*************************************************************       
//* TAG THE RECORDS TO GROUPS AND SORT BASED ON GROUP NUMBER **       
//*************************************************************       
//STEP0100 EXEC PGM=SORT                                               
//SYSOUT   DD SYSOUT=*                                                 
//SORTIN   DD DISP=SHR,DSN=MYUSERID.JOBXSORT                           
//*                                                                   
//*SORTOUT  DD DSN=&&TMP,DISP=(,PASS),SPACE=(CYL,(100,25),RLSE)       
//SORTOUT  DD DSN=MYUSERID.TEST.S1,                                     
//             DISP=(,CATLG),                                         
//             UNIT=SYSDA,SPACE=(CYL,(10,10),RLSE),                   
//             DCB=(*.SORTIN)                                         
//SYSIN    DD *                                                       
  INCLUDE COND=(001,005,CH,EQ,C'1PAGE',OR,                             
                001,133,SS,EQ,C'_!',OR,                               
                001,133,SS,EQ,C'CD_FNZ')                               
                                                                       
  INREC IFOUTLEN=142,                                                 
        IFTHEN=(WHEN=GROUP,BEGIN=(001,5,CH,EQ,C'1PAGE'),               
          PUSH=(134:ID=8)),                                   
        IFTHEN=(WHEN=GROUP,BEGIN=(001,133,SS,EQ,C'CD_FNZ',AND,
                                  134,008,ZD,GT,1),           
          PUSH=(143:134,8)),                                 
        IFTHEN=(WHEN=(143,1,CH,GT,C' '),                     
       OVERLAY=(134:(134,8,ZD,SUB,143,8,ZD),ADD,+1,           
                     M11,LENGTH=8))                           
                                                             
  SORT FIELDS=(134,8,ZD,A),EQUALS                             
                                                             
  OUTFIL OMIT=(001,005,CH,EQ,C'1PAGE',OR,                     
                001,133,SS,EQ,C'CD_FNZ'),                     
  OVERLAY=(144:SEQNUM,8,ZD,RESTART=(134,8))                   

//                                                           

I've used catalogued to retain output, this is what I get here from Step0100:
Code:

----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2----+----3----+----4----+----5-
        1_! CF                 !             1050405   ! 000000000000893994 ! 0576       ! A1B2       ! ESTINTO                !               00000001
        2_! CF                 !             1054016   ! 000000000000909742 ! 5355       ! A1B2       ! ESTINTO                !               00000002
        3_! CF                 !             1048799   ! 000000000000991566 ! 1500       ! A1A5       ! IN AMMORTAMENTO        !               00000003
        4_! CF                 !             1048355   ! 000000000000686623 ! 0646       ! A1B2       ! IN AMMORTAMENTO        !               00000004
        5_! CF                 !             1047049   ! 000000000000860967 ! 8704       ! A1B2       ! ESTINTO                !               00000005
         1_! ESTINZIONE SURROGA PASSIVA                      ! 15.09.2014      !           494647.020  !            12641875   !     00000001  00000001
         2_! ESTINZIONE SURROGA PASSIVA                      ! 18.09.2014      !           313419.060  !            53690612   !     00000001  00000002
         3_! AUTORIZZAZIONE SVINCOLO                         ! 19.09.2014      !           128670.750  !            15747133   !     00000001  00000003
         4_! AUTORIZZAZIONE SVINCOLO                         ! 19.09.2014      !           318325.670  !            88735012   !     00000001  00000004
         5_! ESTINZIONE SURROGA PASSIVA                      ! 19.09.2014      !           113078.430  !            12416624   !     00000001  00000005
        6_! CF                 !             1047096   ! 000000000000930578 ! 0642       ! A1B2       ! ESTINTO                !     00000001  00000006
        7_! CF                 !             1052489   ! 000000000000884280 ! 4803       ! A1B2       ! ESTINTO                !     00000001  00000007
        8_! CF                 !             1053399   ! 000000000000256517 ! 1746       ! A1A5       ! IN AMMORTAMENTO        !     00000001  00000008
        9_! CF                 !             1048363   ! 000000000000859147 ! 7100       ! A1B2       ! ESTINTO                !     00000001  00000009
       10_! CF                 !             1047090   ! 000000000000315638 ! 8100       ! A1B2       ! IN AMMORTAMENTO        !     00000001  00000010
       11_! CF                 !             1049076   ! 000000000000868961 ! 2943       ! A1B2       ! IN AMMORTAMENTO        !     00000001  00000011
       12_! CF                 !             1052425   ! 000000000000823107 ! 2143       ! A1A5       ! ESTINTO                !     00000001  00000012
       13_! CF                 !             1048165   ! 000000000000743013 ! 4378       ! A1B2       ! IN AMMORTAMENTO        !     00000001  00000013
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2----+----3----+----4----+----5-
       14_! CF                 !             1050719   ! 000000000000409155 ! 3343       ! A1B2       ! IN AMMORTAMENTO        !     00000001  00000014
       15_! CF                 !             1053045   ! 000000000000359747 ! 3000       ! A1B2       ! ESTINTO                !     00000001  00000015
       16_! CF                 !             1053027   ! 000000000000664622 ! 6326       ! A1B2       ! IN AMMORTAMENTO        !     00000001  00000016
       17_! CF                 !             1050117   ! 000000000000403909 ! 4146       ! A1B2       ! IN AMMORTAMENTO        !     00000001  00000017
       18_! CF                 !             1052630   ! 000000000000279299 ! 8400       ! A1B14      ! ESTINTO                !     00000001  00000018
       19_! CF                 !             1055671   ! 000000000000317966 ! 8143       ! A1B2       ! ESTINTO                !     00000001  00000019
       20_! CF                 !             1058823   ! 000000000000361969 ! 5500       ! A1B2       ! IN AMMORTAMENTO        !     00000001  00000020
       21_! CF                 !             1054759   ! 000000000000818889 ! 2101       ! A1B2       ! IN AMMORTAMENTO        !     00000001  00000021
       22_! CF                 !             1052792   ! 000000000000871598 ! 1500       ! A1B2       ! IN AMMORTAMENTO        !     00000001  00000022
       23_! CF                 !             1049941   ! 000000000000822856 ! 4368       ! A1B2       ! IN AMMORTAMENTO        !     00000001  00000023
       24_! CF                 !             1046606   ! 000000000000902932 ! 8400       ! A1B14      ! IN AMMORTAMENTO        !     00000001  00000024
       25_! CF                 !             1061412   ! 000000000000378059 ! 6312       ! A1B2       ! IN AMMORTAMENTO        !     00000001  00000025
       26_! CF                 !             1060521   ! 000000000000371617 ! 6312       ! A1B2       ! IN AMMORTAMENTO        !     00000001  00000026
       27_! CF                 !             1059175   ! 000000000000680593 ! 7023       ! A1B2       ! ESTINTO                !     00000001  00000027
       28_! CF                 !             1057664   ! 000000000000896052 ! 0907       ! A1B2       ! ESTINTO                !     00000001  00000028
       29_! CF                 !             1055023   ! 000000000000341159 ! 2850       ! A1B2       ! IN AMMORTAMENTO        !     00000001  00000029
       30_! CF                 !             1059284   ! 000000000000880407 ! 4309       ! A1B2       ! IN AMMORTAMENTO        !     00000001  00000030
       31_! CF                 !             1054468   ! 000000000000257709 ! 0743       ! A1B14      ! IN AMMORTAMENTO        !     00000001  00000031
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2----+----3----+----4----+----5-
       32_! CF                 !             1057603   ! 000000000000673135 ! 7077       ! A1B2       ! IN AMMORTAMENTO        !     00000001  00000032
       33_! CF                 !             1054773   ! 000000000000864113 ! 4243       ! A1B2       ! IN AMMORTAMENTO        !     00000001  00000033
       34_! CF                 !             1056215   ! 000000000000395046 ! 1846       ! A1B2       ! IN AMMORTAMENTO        !     00000001  00000034
       35_! CF                 !             1053926   ! 000000000000579059 ! 4361       ! A1B2       ! ESTINTO                !     00000001  00000035
       36_! CF                 !             1058926   ! 000000000000800979 ! 2849       ! A1B2       ! IN AMMORTAMENTO        !     00000001  00000036
       37_! CF                 !             1051623   ! 000000000000852622 ! 7744       ! A1B2       ! IN AMMORTAMENTO        !     00000001  00000037
       38_! CF                 !             1053853   ! 000000002358538000 ! 5400       ! A1B2       ! IN AMMORTAMENTO        !     00000001  00000038
       39_! CF                 !             1061489   ! 000000000000844695 ! 6002       ! A1B2       ! IN AMMORTAMENTO        !     00000001  00000039
       40_! CF                 !             1060132   ! 000000000000833391 ! 4701       ! A1B2       ! ESTINTO                !     00000001  00000040
       41_! CF                 !             1060277   ! 000000000000843583 ! 1500       ! A1B2       ! ESTINTO                !     00000001  00000041
       42_! CF                 !             1048566   ! 000000000000797199 ! 7044       ! A1B2       ! IN AMMORTAMENTO        !     00000001  00000042
       43_! CF                 !             1048261   ! 000000000000892185 ! 2803       ! A1B2       ! IN AMMORTAMENTO        !     00000001  00000043
       44_! CF                 !             1048326   ! 000000000000397226 ! 3952       ! A1B2       ! ESTINTO                !     00000001  00000044
       45_! CF                 !             1062173   ! 000000000000866879 ! 6490       ! A1B2       ! ESTINTO                !     00000001  00000045
       46_! CF                 !             1063873   ! 000000000000485479 ! 6439       ! A1B2       ! IN AMMORTAMENTO        !     00000001  00000046
       47_! CF                 !             1060397   ! 000000000000298267 ! 4707       ! A1B2       ! IN AMMORTAMENTO        !     00000001  00000047
       48_! CF                 !             1061036   ! 000000000000842864 ! 0507       ! A1A5       ! ESTINTO                !     00000001  00000048
       49_! CF                 !             1058860   ! 000000000000866523 ! 5843       ! A1A5       ! ESTINTO                !     00000001  00000049
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2----+----3----+----4----+----5-
       50_! CF                 !             1059145   ! 000000000000913999 ! 0564       ! A1A5       ! ESTINTO                !     00000001  00000050
       51_! CF                 !             1063573   ! 000000000000740503 ! 5101       ! A1B2       ! ESTINTO                !     00000001  00000051
       52_! CF                 !             1063427   ! 000000000000867848 ! 1244       ! A1B11      ! ESTINTO                !     00000001  00000052
       53_! CF                 !             1064165   ! 000000000000383450 ! 6319       ! A1A5       ! ESTINTO                !     00000001  00000053
       54_! CF                 !             1059984   ! 000000000000914976 ! 0904       ! A1B2       ! ESTINTO                !     00000001  00000054
       55_! CF                 !             1061346   ! 000000000000791138 ! 0546       ! A1A5       ! ESTINTO                !     00000001  00000055
       56_! CF                 !             1061703   ! 000000000000842050 ! 3702       ! A1A5       ! IN AMMORTAMENTO        !     00000001  00000056
       57_! CF                 !             1061909   ! 000000000001004489 ! 4360       ! A1B2       ! ESTINTO                !     00000001  00000057
       58_! CF                 !             1059848   ! 000000000000386496 ! 0567       ! A1B2       ! IN AMMORTAMENTO        !     00000001  00000058
       59_! CF                 !             1064278   ! 000000000000240283 ! 0949       ! A1A5       ! ESTINTO                !     00000001  00000059
       60_! CF                 !             1064706   ! 000000000000972403 ! 0103       ! A1B5       ! ESTINTO                !     00000001  00000060
       61_! CF                 !             1062649   ! 000000000000773492 ! 3313       ! A1A5       ! ESTINTO                !     00000001  00000061
       62_! CF                 !             1063108   ! 000000000000363055 ! 6800       ! A1B2       ! ESTINTO                !     00000001  00000062
       63_! CF                 !             1062938   ! 000000000000587285 ! 0644       ! A1B2       ! ESTINTO                !     00000001  00000063
       64_! CF                 !             1063855   ! 000000000000273235 ! 4143       ! A1B2       ! ESTINTO                !     00000001  00000064
       65_! CF                 !             1064888   ! 000000000000943803 ! 4305       ! A1B2       ! ESTINTO                !     00000001  00000065
       66_! CF                 !             1061348   ! 000000000000271984 ! 4320       ! A1B2       ! ESTINTO                !     00000001  00000066
       67_! CF                 !             1064855   ! 000000000000957777 ! 4325       ! A1B2       ! IN AMMORTAMENTO        !     00000001  00000067
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2----+----3----+----4----+----5-
       68_! CF                 !             1063263   ! 000000000000351702 ! 0975       ! A1A5       ! ESTINTO                !     00000001  00000068
       69_! CF                 !             1065727   ! 000000000000777108 ! 4565       ! A1B2       ! ESTINTO                !     00000001  00000069
       70_! CF                 !             1065479   ! 000000000000349093 ! 4246       ! A1B2       ! IN AMMORTAMENTO        !     00000001  00000070
       71_! CF                 !             1065266   ! 000000000000952206 ! 6002       ! A1A5       ! IN AMMORTAMENTO        !     00000001  00000071
       72_! CF                 !             1068705   ! 000000002424151000 ! 6439       ! A1A5       ! IN AMMORTAMENTO        !     00000001  00000072
       73_! CF                 !             1063549   ! 000000000000857767 ! 7502       ! A1A5       ! ESTINTO                !     00000001  00000073
       74_! CF                 !             1063780   ! 000000000000787280 ! 0507       ! A1B2       ! ESTINTO                !     00000001  00000074
       75_! CF                 !             1064724   ! 000000000000747023 ! 6555       ! A1A5       ! ESTINTO                !     00000001  00000075
       76_! CF                 !             1064677   ! 000000000000767863 ! 0546       ! A1A5       ! ESTINTO                !     00000001  00000076
       77_! CF                 !             1062595   ! 000000000000810002 ! 4200       ! A1B2       ! IN AMMORTAMENTO        !     00000001  00000077
       78_! CF                 !             1062489   ! 000000000000867194 ! 7013       ! A1A5       ! IN AMMORTAMENTO        !     00000001  00000078
       79_! CF                 !             1060436   ! 000000000000788094 ! 6373       ! A1A5       ! ESTINTO                !     00000001  00000079
       80_! CF                 !             1062789   ! 000000000000446410 ! 0500       ! A1A5       ! ESTINTO                !     00000001  00000080
       81_! CF                 !             1064623   ! 000000000000887524 ! 3052       ! A1A5       ! ESTINTO                !     00000001  00000081
       82_! CF                 !             1066730   ! 000000000000321718 ! 0644       ! A1B2       ! IN AMMORTAMENTO        !     00000001  00000082
       83_! CF                 !             1058008   ! 000000000000731084 ! 1700       ! A1B2       ! ESTINTO                !     00000001  00000083
       84_! CF                 !             1056230   ! 000000000000663962 ! 0508       ! A1B14      ! ESTINTO                !     00000001  00000084
       85_! CF                 !             1069190   ! 000000000000723875 ! 0100       ! A1A5       ! ESTINTO                !     00000001  00000085
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2----+----3----+----4----+----5-
       86_! CF                 !             1069024   ! 000000000000848280 ! 0576       ! A1B2       ! ESTINTO                !     00000001  00000086
       87_! CF                 !             1058645   ! 000000000000154094 ! 3000       ! A1B14      ! IN AMMORTAMENTO        !     00000001  00000087
       88_! CF                 !             1054454   ! 000000000000975825 ! 3343       ! A1B2       ! IN AMMORTAMENTO        !     00000001  00000088
       89_! CF                 !             1065774   ! 000000000000925323 ! 2449       ! A1A5       ! ESTINTO                !     00000001  00000089
       90_! CF                 !             1068660   ! 000000000000420600 ! 4320       ! A1B2       ! ESTINTO                !     00000001  00000090
       91_! CF                 !             1068361   ! 000000000000450569 ! 4500       ! A1B2       ! IN AMMORTAMENTO        !     00000001  00000091
       92_! CF                 !             1064327   ! 000000000001030983 ! 6477       ! A1B2       ! ESTINTO                !     00000001  00000092
       93_! CF                 !             1063792   ! 000000000000909474 ! 8401       ! A1B2       ! ESTINTO                !     00000001  00000093
       94_! CF                 !             1062480   ! 000000000000407284 ! 0600       ! A1B2       ! IN AMMORTAMENTO        !     00000001  00000094
       95_! CF                 !             1061772   ! 000000000000414158 ! 4320       ! A1B2       ! ESTINTO                !     00000001  00000095
       96_! CF                 !             1059959   ! 000000000000934853 ! 8401       ! A1B2       ! ESTINTO                !     00000001  00000096
       97_! CF                 !             1062731   ! 000000000000206408 ! 3377       ! A1B2       ! IN AMMORTAMENTO        !     00000001  00000097
       98_! CF                 !             1064631   ! 000000000000527433 ! 5000       ! A1B2       ! IN AMMORTAMENTO        !     00000001  00000098
       99_! CF                 !             1064892   ! 000000000000760865 ! 3949       ! A1B2       ! IN AMMORTAMENTO        !     00000001  00000099
      100_! CF                 !             1064972   ! 000000000000646567 ! 8405       ! A1B2       ! IN AMMORTAMENTO        !     00000001  00000100
      101_! CF                 !             1057889   ! 000000000000871639 ! 0576       ! A1B2       ! IN AMMORTAMENTO        !     00000001  00000101
      102_! CF                 !             1065046   ! 000000000000204306 ! 6330       ! A1A5       ! ESTINTO                !     00000001  00000102
      103_! CF                 !             1065361   ! 000000000001012474 ! 7058       ! A1A5       ! ESTINTO                !     00000001  00000103
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2----+----3----+----4----+----5-
      104_! CF                 !             1061675   ! 000000000000266201 ! 7077       ! A1B2       ! IN AMMORTAMENTO        !     00000001  00000104
      105_! CF                 !             1068902   ! 000000000000914674 ! 4300       ! A1B2       ! ESTINTO                !     00000001  00000105
      106_! CF                 !             1062488   ! 000000000000375373 ! 0500       ! A1B5       ! IN AMMORTAMENTO        !     00000001  00000106
      107_! CF                 !             1062140   ! 000000000000352671 ! 4313       ! A1B2       ! IN AMMORTAMENTO        !     00000001  00000107
      108_! CF                 !             1063052   ! 000000000000234259 ! 6800       ! A1A5       ! ESTINTO                !     00000001  00000108
      109_! CF                 !             1064363   ! 000000000000314598 ! 6350       ! A1B2       ! IN AMMORTAMENTO        !     00000001  00000109
      110_! CF                 !             1064308   ! 000000000000703368 ! 0543       ! A1A5       ! ESTINTO                !     00000001  00000110
      111_! CF                 !             1059070   ! 000000000000615545 ! 6308       ! A1B2       ! IN AMMORTAMENTO        !     00000001  00000111
      112_! CF                 !             1065329   ! 000000000000400846 ! 3843       ! A1B2       ! IN AMMORTAMENTO        !     00000001  00000112
      113_! CF                 !             1052957   ! 000000000000408195 ! 2801       ! A1B2       ! ESTINTO                !     00000001  00000113
      114_! CF                 !             1069888   ! 000000000000400739 ! 4352       ! A1B2       ! IN AMMORTAMENTO        !     00000001  00000114
      115_! CF                 !             1072352   ! 000000000000310795 ! 3946       ! A1B2       ! ESTINTO                !     00000001  00000115
      116_! CF                 !             1072240   ! 000000000000865388 ! 7014       ! A1A5       ! ESTINTO                !     00000001  00000116
      117_! CF                 !             1072030   ! 000000000000325737 ! 8401       ! A1B2       ! IN AMMORTAMENTO        !     00000001  00000117
      118_! CF                 !             1073040   ! 000000000000929740 ! 3300       ! A1B2       ! ESTINTO                !     00000001  00000118
      119_! CF                 !             1073311   ! 000000000000840441 ! 4321       ! A1A5       ! ESTINTO                !     00000001  00000119
      120_! CF                 !             1051529   ! 000000000000338439 ! 6330       ! A1B2       ! IN AMMORTAMENTO        !     00000001  00000120
      121_! CF                 !             1049093   ! 000000000000205989 ! 6411       ! A1B2       ! ESTINTO                !     00000001  00000121
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2----+----3----+----4----+----5-
      122_! CF                 !             1050210   ! 000000000000275169 ! 6330       ! A1B2       ! ESTINTO                !     00000001  00000122
      123_! CF                 !             1067867   ! 000000000000332468 ! 1846       ! A1A5       ! IN AMMORTAMENTO        !     00000001  00000123
      124_! CF                 !             1066712   ! 000000000000489592 ! 6652       ! A1B2       ! IN AMMORTAMENTO        !     00000001  00000124
      125_! CF                 !             1066090   ! 000000000000780154 ! 5101       ! A1B2       ! ESTINTO                !     00000001  00000125
      126_! CF                 !             1063853   ! 000000000000648866 ! 0508       ! A1B2       ! ESTINTO                !     00000001  00000126
      127_! CF                 !             1071370   ! 000000000000806324 ! 3702       ! A1B2       ! ESTINTO                !     00000001  00000127
      128_! CF                 !             1071120   ! 000000000000327585 ! 6339       ! A1A5       ! ESTINTO                !     00000001  00000128
      129_! CF                 !             1070822   ! 000000000000903811 ! 4368       ! A1B2       ! IN AMMORTAMENTO        !     00000001  00000129
      130_! CF                 !             1069843   ! 000000000000588724 ! 4773       ! A1B2       ! IN AMMORTAMENTO        !     00000001  00000130
      131_! CF                 !             1070135   ! 000000000000761968 ! 0100       ! A1A5       ! ESTINTO                !     00000001  00000131
      132_! CF                 !             1070083   ! 000000000000937668 ! 4443       ! A1A5       ! ESTINTO                !     00000001  00000132
      133_! CF                 !             1070494   ! 000000000000630626 ! 4801       ! A1B2       ! ESTINTO                !     00000001  00000133
      134_! CF                 !             1064455   ! 000000000000301930 ! 0100       ! A1A5       ! ESTINTO                !     00000001  00000134
      135_! CF                 !             1063595   ! 000000000000597568 ! 2849       ! A1B14      ! ESTINTO                !     00000001  00000135
      136_! CF                 !             1066003   ! 000000000000446023 ! 7058       ! A1A5       ! ESTINTO                !     00000001  00000136
      137_! CF                 !             1067620   ! 000000000000994633 ! 7058       ! A1A5       ! ESTINTO                !     00000001  00000137
      138_! CF                 !             1067992   ! 000000000000945982 ! 3949       ! A1B2       ! ESTINTO                !     00000001  00000138
      139_! CF                 !             1068628   ! 000000000000491427 ! 4313       ! A1B2       ! IN AMMORTAMENTO        !     00000001  00000139
...

To me there's something not correct, see this block in the beginning for example
Code:

----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2----+----3----+----4----+----5-
        1_! CF                 !             1050405   ! 000000000000893994 ! 0576       ! A1B2       ! ESTINTO                !               00000001
        2_! CF                 !             1054016   ! 000000000000909742 ! 5355       ! A1B2       ! ESTINTO                !               00000002
        3_! CF                 !             1048799   ! 000000000000991566 ! 1500       ! A1A5       ! IN AMMORTAMENTO        !               00000003
        4_! CF                 !             1048355   ! 000000000000686623 ! 0646       ! A1B2       ! IN AMMORTAMENTO        !               00000004
        5_! CF                 !             1047049   ! 000000000000860967 ! 8704       ! A1B2       ! ESTINTO                !               00000005
         1_! ESTINZIONE SURROGA PASSIVA                      ! 15.09.2014      !           494647.020  !            12641875   !     00000001  00000001
         2_! ESTINZIONE SURROGA PASSIVA                      ! 18.09.2014      !           313419.060  !            53690612   !     00000001  00000002
         3_! AUTORIZZAZIONE SVINCOLO                         ! 19.09.2014      !           128670.750  !            15747133   !     00000001  00000003
         4_! AUTORIZZAZIONE SVINCOLO                         ! 19.09.2014      !           318325.670  !            88735012   !     00000001  00000004
         5_! ESTINZIONE SURROGA PASSIVA                      ! 19.09.2014      !           113078.430  !            12416624   !     00000001  00000005

you can see first block (starting from 1_ to 5_) is repeated for the initial part and from the part that we want to concatenate. But you can also see that with the new sort code this happen only the first time, after that there a big block 00000001 followed byt another big block 00000002. So the first block from 1_ to 5_ should be there only for the beginning part, the other part should belong to block 00000002.

Sorry Kolusu I lost half of the post, too long. Let's continue on the next post...
Back to top
View user's profile Send private message
Fab
Beginner


Joined: 15 Nov 2016
Posts: 47
Topics: 6

PostPosted: Wed May 10, 2017 8:22 am    Post subject: Reply with quote

...continued from previous post

This is when begins big block 2:
Code:

----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8---+----8----+----9----+----0----+----1----+----2----+----3----+----4----+----5-
    38074_! CF                 !             1330728   ! 000000000001165456 ! 645456 ! 6411       ! A1A5       ! IN AMMORTAMENTO        !     00000001  00038074
    38075_! CF                 !             1330253   ! 000000000000225320 ! 675320 ! 6700       ! A1A5       ! IN AMMORTAMENTO        !     00000001  00038075
    38076_! CF                 !             1324157   ! 000000000001148418 ! 298418 ! 2900       ! A1A5       ! IN AMMORTAMENTO        !     00000001  00038076
         6_! ESTINZIONE SURROGA PASSIVA                      ! 22.09.2014      !14      !           121374.290  !            12751488   !     00000002  00000001
         7_! ESTINZIONE ANTICIPATA                           ! 22.09.2014      !14      !           101474.330  !            12669672   !     00000002  00000002
         8_! AUTORIZZAZIONE SVINCOLO                         ! 22.09.2014      !14      !            31028.670  !            17076074   !     00000002  00000003
         9_! ESTINZIONE ANTICIPATA                           ! 23.09.2014      !14      !            92864.150  !            71309157   !     00000002  00000004
        10_! AUTORIZZAZIONE SVINCOLO                         ! 23.09.2014      !14      !            71636.600  !             2411962   !     00000002  00000005
        11_! AUTORIZZAZIONE SVINCOLO                         ! 03.10.2014      !14      !           115343.120  !            53684416   !     00000002  00000006
        12_! ESTINZIONE ANTICIPATA                           ! 03.10.2014      !14      !            92913.380  !             7779413   !     00000002  00000007
        13_! AUTORIZZAZIONE SVINCOLO                         ! 06.10.2014      !14      !           135009.570  !             7513895   !     00000002  00000008
        14_! AUTORIZZAZIONE SVINCOLO                         ! 07.10.2014      !14      !           158968.470  !            33464353   !     00000002  00000009
        15_! ESTINZIONE ANTICIPATA                           ! 07.10.2014      !14      !            77438.080  !             9573289   !     00000002  00000010
        16_! AUTORIZZAZIONE SVINCOLO                         ! 08.10.2014      !14      !           181805.200  !             6721347   !     00000002  00000011
        17_! AUTORIZZAZIONE SVINCOLO                         ! 08.10.2014      !14      !           128824.610  !             2759756   !     00000002  00000012
        18_! ESTINZIONE ANTICIPATA                           ! 09.10.2014      !14      !           129059.060  !            78515845   !     00000002  00000013
        19_! ESTINZIONE ANTICIPATA                           ! 09.10.2014      !14      !           100410.420  !             2447562   !     00000002  00000014
        20_! AUTORIZZAZIONE SVINCOLO                         ! 09.10.2014      !14      !           250723.810  !            88698652   !     00000002  00000015

As you can see the block starting from _1 to _5 is missing, because it is located at the beginning of the file.

executing the other steps this is what I've got:
Step0200 (the same sort code you've posted days ago)
Code:

----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2----+----3-
 CF                 !             1050405   ! 000000000000893994 ! 0576       ! A1B2       ! ESTINTO                !             
 ESTINZIONE SURROGA PASSIVA                      ! 15.09.2014      !           494647.020  !            12641875   !               
 ESTINZIONE SURROGA PASSIVA                      ! 22.09.2014      !           121374.290  !            12751488   !               
 CF                 !             1054016   ! 000000000000909742 ! 5355       ! A1B2       ! ESTINTO                !             
 ESTINZIONE SURROGA PASSIVA                      ! 18.09.2014      !           313419.060  !            53690612   !               
 ESTINZIONE ANTICIPATA                           ! 22.09.2014      !           101474.330  !            12669672   !               
 CF                 !             1048799   ! 000000000000991566 ! 1500       ! A1A5       ! IN AMMORTAMENTO        !             
 AUTORIZZAZIONE SVINCOLO                         ! 19.09.2014      !           128670.750  !            15747133   !               
 AUTORIZZAZIONE SVINCOLO                         ! 22.09.2014      !            31028.670  !            17076074   !               
 CF                 !             1048355   ! 000000000000686623 ! 0646       ! A1B2       ! IN AMMORTAMENTO        !             
 AUTORIZZAZIONE SVINCOLO                         ! 19.09.2014      !           318325.670  !            88735012   !               
 ESTINZIONE ANTICIPATA                           ! 23.09.2014      !            92864.150  !            71309157   !               
 CF                 !             1047049   ! 000000000000860967 ! 8704       ! A1B2       ! ESTINTO                !             
 ESTINZIONE SURROGA PASSIVA                      ! 19.09.2014      !           113078.430  !            12416624   !               
 AUTORIZZAZIONE SVINCOLO                         ! 23.09.2014      !            71636.600  !             2411962   !               
 CF                 !             1047096   ! 000000000000930578 ! 0642       ! A1B2       ! ESTINTO                !             
 AUTORIZZAZIONE SVINCOLO                         ! 03.10.2014      !           115343.120  !            53684416   !               
 CF                 !             1052489   ! 000000000000884280 ! 4803       ! A1B2       ! ESTINTO                !             
 ESTINZIONE ANTICIPATA                           ! 03.10.2014      !            92913.380  !             7779413   !               


Step0300
File TLN (with dynamic lenght)
Code:

----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
  TOLEN(00000262)                                                               

And this is the final output, a bit of a mess as you can see.
Column 1-200
Code:

----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0
 CF                 !             1050405   ! 000000000000893994 ! 0576       ! A1B2       ! ESTINTO                !               ESTINZIONE SURROGA PASSIVA                      ! 15.09.2014      !
 ESTINZIONE SURROGA PASSIVA                      ! 22.09.2014      !           121374.290  !            12751488   !                CF                 !             1054016   ! 000000000000909742 ! 53
 ESTINZIONE SURROGA PASSIVA                      ! 18.09.2014      !           313419.060  !            53690612   !                ESTINZIONE ANTICIPATA                           ! 22.09.2014      !
 CF                 !             1048799   ! 000000000000991566 ! 1500       ! A1A5       ! IN AMMORTAMENTO        !               AUTORIZZAZIONE SVINCOLO                         ! 19.09.2014      !
 AUTORIZZAZIONE SVINCOLO                         ! 22.09.2014      !            31028.670  !            17076074   !                CF                 !             1048355   ! 000000000000686623 ! 06
 AUTORIZZAZIONE SVINCOLO                         ! 19.09.2014      !           318325.670  !            88735012   !                ESTINZIONE ANTICIPATA                           ! 23.09.2014      !
 CF                 !             1047049   ! 000000000000860967 ! 8704       ! A1B2       ! ESTINTO                !               ESTINZIONE SURROGA PASSIVA                      ! 19.09.2014      !
 AUTORIZZAZIONE SVINCOLO                         ! 23.09.2014      !            71636.600  !             2411962   !                CF                 !             1047096   ! 000000000000930578 ! 06
 AUTORIZZAZIONE SVINCOLO                         ! 03.10.2014      !           115343.120  !            53684416   !                CF                 !             1052489   ! 000000000000884280 ! 48
 ESTINZIONE ANTICIPATA                           ! 03.10.2014      !            92913.380  !             7779413   !                CF                 !             1053399   ! 000000000000256517 ! 17
 AUTORIZZAZIONE SVINCOLO                         ! 06.10.2014      !           135009.570  !             7513895   !                CF                 !             1048363   ! 000000000000859147 ! 71
 AUTORIZZAZIONE SVINCOLO                         ! 07.10.2014      !           158968.470  !            33464353   !                CF                 !             1047090   ! 000000000000315638 ! 81
 ESTINZIONE ANTICIPATA                           ! 07.10.2014      !            77438.080  !             9573289   !                CF                 !             1049076   ! 000000000000868961 ! 29
 AUTORIZZAZIONE SVINCOLO                         ! 08.10.2014      !           181805.200  !             6721347   !                CF                 !             1052425   ! 000000000000823107 ! 21
 AUTORIZZAZIONE SVINCOLO                         ! 08.10.2014      !           128824.610  !             2759756   !                CF                 !             1048165   ! 000000000000743013 ! 43
 ESTINZIONE ANTICIPATA                           ! 09.10.2014      !           129059.060  !            78515845   !                CF                 !             1050719   ! 000000000000409155 ! 33
 ESTINZIONE ANTICIPATA                           ! 09.10.2014      !           100410.420  !             2447562   !                CF                 !             1053045   ! 000000000000359747 ! 30
 AUTORIZZAZIONE SVINCOLO                         ! 09.10.2014      !           250723.810  !            88698652   !                CF                 !             1053027   ! 000000000000664622 ! 63
 AUTORIZZAZIONE SVINCOLO                         ! 10.10.2014      !            84172.290  !             1426817   !                CF                 !             1050117   ! 000000000000403909 ! 41


column 201-262
Code:

----+----1----+----2----+----3----+----4----+----5----+----6--
          494647.020  !            12641875   !               
55       ! A1B2       ! ESTINTO                !             
          101474.330  !            12669672   !               
          128670.750  !            15747133   !               
46       ! A1B2       ! IN AMMORTAMENTO        !             
           92864.150  !            71309157   !               
          113078.430  !            12416624   !               
42       ! A1B2       ! ESTINTO                !             
03       ! A1B2       ! ESTINTO                !             
46       ! A1A5       ! IN AMMORTAMENTO        !             
00       ! A1B2       ! ESTINTO                !             
00       ! A1B2       ! IN AMMORTAMENTO        !             
43       ! A1B2       ! IN AMMORTAMENTO        !             
43       ! A1A5       ! ESTINTO                !             
78       ! A1B2       ! IN AMMORTAMENTO        !             
43       ! A1B2       ! IN AMMORTAMENTO        !             
00       ! A1B2       ! ESTINTO                !             
26       ! A1B2       ! IN AMMORTAMENTO        !             
46       ! A1B2       ! IN AMMORTAMENTO        !             
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12357
Topics: 75
Location: San Jose

PostPosted: Wed May 10, 2017 11:20 am    Post subject: Reply with quote

Fab,

Please check your Private message about how to send the input file.
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12357
Topics: 75
Location: San Jose

PostPosted: Mon May 15, 2017 8:05 pm    Post subject: Reply with quote

Fab,

I finally got your input today and here is the JCL that will merge them into a single records. Depending on your data, you just need 1 sort and 2 copy passes.

Code:

//*************************************************************
//* TAG THE RECORDS TO GROUPS AND SORT BASED ON GROUP NUMBER **
//*************************************************************
//STEP0100 EXEC PGM=SORT                                       
//SYSOUT   DD SYSOUT=*                                         
//SORTIN   DD DISP=SHR,DSN=Your Unload data     
//SORTOUT  DD DSN=&&TMP,DISP=(,PASS),SPACE=(CYL,(25,25),RLSE) 
//SYSIN    DD *                                               
  OPTION COPY                                                 
                                                               
  INCLUDE COND=(001,005,CH,EQ,C'1PAGE',OR,                     
                001,133,SS,EQ,C'_|',OR,                       
                001,133,SS,EQ,C'CD_FNZ')                       
                                                               
  INREC IFOUTLEN=142,                                         
        IFTHEN=(WHEN=GROUP,BEGIN=(001,5,CH,EQ,C'1PAGE'),       
          PUSH=(134:ID=8)),                                   
        IFTHEN=(WHEN=GROUP,BEGIN=(001,133,SS,EQ,C'CD_FNZ',AND,
                                  134,008,ZD,GT,1),           
          PUSH=(144:134,8)),                                   
                                                               
        IFTHEN=(WHEN=(134,1,CH,EQ,C' ',AND,                   
                      144,1,CH,EQ,C' '),                       
       OVERLAY=(134:8C'A')),                                   
                                                               
        IFTHEN=(WHEN=(134,1,CH,GT,C' ',AND,                   
                      144,1,CH,EQ,C' '),                       
       OVERLAY=(134:8C'B')),                                   
                                                               
        IFTHEN=(WHEN=(144,1,CH,GT,C' '),                       
       OVERLAY=(134:(134,8,ZD,SUB,144,8,ZD),ADD,+1,           
                     M11,LENGTH=8))                           
                                                               
  OUTREC IFTHEN=(WHEN=(001,005,CH,EQ,C'1PAGE',OR,             
                       001,133,SS,EQ,C'CD_FNZ'),               
         OVERLAY=(134:8X)),                                   
         IFTHEN=(WHEN=NONE,                                   
         OVERLAY=(143:SEQNUM,3,ZD,RESTART=(134,8)))           
                                                               
                                                                     
  OUTFIL OMIT=(134,1,CH,EQ,C' '),                                   
        IFTHEN=(WHEN=GROUP,BEGIN=(134,12,CH,EQ,C'00000001 001'),     
                PUSH=(150:ID=8)),                                   
        IFTHEN=(WHEN=INIT,                                           
                BUILD=(1,133,150,8,143,3))                           
//*                                                                 
//*************************************************************     
//* SORT THE RECORDS SO THE DATA IS ORDERED AS IN DB2 TABLE  **     
//*************************************************************     
//STEP0200 EXEC PGM=SORT                                             
//SYSOUT   DD SYSOUT=*                                               
//SORTIN   DD DSN=&&TMP,DISP=SHR                                     
//SORTOUT  DD DSN=&&DAF,DISP=(,PASS),SPACE=(CYL,(25,25),RLSE)       
//TLN      DD DSN=&&TLN,DISP=(,PASS),SPACE=(TRK,(1,0),RLSE)         
//SYSIN    DD *                                                     
  SORT FIELDS=(142,3,CH,A,                                           
               134,8,CH,A),EQUALS                                   
                                                                     
  OUTREC OVERLAY=(147:SEQNUM,3,ZD,RESTART=(134,8),                   
                  152:147,3,ZD,MUL,+131,M11,LENGTH=5)               
                                                                     
  OUTFIL IFTHEN=(WHEN=INIT,BUILD=(2,132)),                           
         IFTHEN=(WHEN=INIT,                                         
         PARSE=(%01=(STARTAFT=C'_',FIXLEN=132)),                     
              BUILD=(%01,JFY=(SHIFT=LEFT))),                         
         IFTHEN=(WHEN=INIT,BUILD=(2,131))                           
                                                                     
  OUTFIL FNAMES=TLN,REMOVECC,NODETAIL,BUILD=(80X),                   
  TRAILER1=(3:'TOLEN(',                                             
            MAX=(152,5,ZD,EDIT=(TTTTT)),                             
            ')')                                                     
//*                                                                 
//**************************************************************
//*   NOW RESIZE THE DATA INTO A SINGLE RECORD                **
//**************************************************************
//STEP0300 EXEC PGM=ICETOOL                                     
//TOOLMSG  DD SYSOUT=*                                         
//DFSMSG   DD SYSOUT=*                                         
//DAF      DD DISP=(OLD,PASS),DSN=&&DAF                         
//OUT      DD SYSOUT=*                                         
//TOOLIN   DD *                                                 
  RESIZE FROM(DAF) TO(OUT) -                                   
//         DD DISP=(OLD,PASS),DSN=&&TLN                         
//*

_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Goto page Previous  1, 2, 3  Next
Page 2 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group