Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Detect break in the sequence

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
tuxama

New User


Joined: 25 Jan 2007
Posts: 35
Location: france

PostPosted: Tue Mar 20, 2018 1:35 pm    Post subject: Detect break in the sequence
Reply with quote

Hi all,

I have the following input file (lrecl=80, recfm=fb)

Code:
SORTIN DD *
234112
234113
234114
235116
235118
235119
237121
238122
238123
/*


I need to detect the break in the sequence in order to produce the output file below (lrecl=80, recfm=fb).

Code:
SORTOUT DD *
234112 235116
235116 235118
235118 237121
237121 238123
/*



I have no idea how to proceed or even if it is possible with a dfsort.

Can I have your opinion and your help ?

Thank you in advance
Back to top
View user's profile Send private message

enrico-sorichetti

Senior Member


Joined: 14 Mar 2007
Posts: 10541
Location: italy

PostPosted: Tue Mar 20, 2018 4:01 pm    Post subject:
Reply with quote

see if You can get some ideas here
http://ibmmainframes.com/viewtopic.php?t=60704&highlight=sequence

but as far as developing and testing

doing it with a cobol/whatever_other_language program
should take only a few minutes

doing it with dfsort a bit more ...
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2448
Location: @my desk

PostPosted: Tue Mar 20, 2018 8:10 pm    Post subject: Reply to: Detect break in the sequence
Reply with quote

Code:
237121
238122
Is this not a 'break' here? Considering 237 changed to 238 in the sequence number. Or was that a typo?
Back to top
View user's profile Send private message
tuxama

New User


Joined: 25 Jan 2007
Posts: 35
Location: france

PostPosted: Tue Mar 20, 2018 9:32 pm    Post subject:
Reply with quote

Big mistake

Code:
SORTOUT DD *
234112 234114
235116 235116
235118 235119
237121 237121
238122 238123
/*
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2448
Location: @my desk

PostPosted: Tue Mar 20, 2018 11:19 pm    Post subject:
Reply with quote

Like enrico mentioned, a little bit of coding might be a better choice, since this is pretty much straightforward.

I tried a quick DFSORT version and came up with this. Will post back if I can make it any better or if I find any bugs.
Code:
//STEP01  EXEC PGM=SORT                                       
//SYSOUT    DD SYSOUT=*                                       
//SORTOUT   DD SYSOUT=*                                       
//SORTJNF1  DD DISP=SHR,DSN= Input      (FB/80)
//SORTJNF2  DD DISP=SHR,DSN= Same Input (FB/80)
//SYSIN     DD *                                               
 JOINKEYS FILE=F1,FIELDS=(81,8,A),SORTED,NOSEQCK               
 JOINKEYS FILE=F2,FIELDS=(81,8,A),SORTED,NOSEQCK               
 JOIN UNPAIRED,F1                                             
 REFORMAT FIELDS=(F1:1,6,F2:1,6,?)                             
 INREC IFTHEN=(WHEN=(13,1,CH,EQ,C'B'),                         
      OVERLAY=(07:(7,6,ZD,ADD,+1),SUB,1,6,ZD,M11,LENGTH=6))   
 SORT FIELDS=COPY                                             
 OUTREC IFTHEN=(WHEN=GROUP,BEGIN=(7,6,CH,NE,C'000000'),       
          PUSH=(15:1,6))                                       
 OUTFIL REMOVECC,NODETAIL,SECTIONS=(15,6,                     
      TRAILER3=(15,6,X,1,6)),BUILD=(80X)                       
/*                                                             
//JNF1CNTL  DD *                             
 INREC OVERLAY=(81:SEQNUM,8,ZD,START=0)       
//JNF2CNTL  DD *                             
 INREC OVERLAY=(81:SEQNUM,8,ZD)
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2448
Location: @my desk

PostPosted: Wed Mar 21, 2018 12:33 am    Post subject:
Reply with quote

A friend of mine suggested this can be further simplified, So I have an updated version of the above, which needs only one input and does not need the JOIN operation.
Code:
//SYSIN     DD *                                         
 SORT FIELDS=COPY                                       
 OUTREC IFTHEN=(WHEN=INIT,                               
       OVERLAY=(81:SEQNUM,6,ZD,                         
                81:1,6,ZD,SUB,81,6,ZD,M11,LENGTH=6)),   
        IFTHEN=(WHEN=GROUP,KEYBEGIN=(81,6),PUSH=(81:1,6))
 OUTFIL REMOVECC,NODETAIL,SECTIONS=(81,6,               
      TRAILER3=(81,6,X,1,6)),BUILD=(80X)                 
Back to top
View user's profile Send private message
tuxama

New User


Joined: 25 Jan 2007
Posts: 35
Location: france

PostPosted: Wed Mar 21, 2018 2:14 pm    Post subject:
Reply with quote

Respect for this work Arun.
I am impressed.

Thank you very much for this solution that solves my problem.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Break Auto update screen without message packerm TSO/ISPF 2 Wed Oct 03, 2018 2:44 pm
No new posts Question about dataset sequence numbe... harisukumaran JCL & VSAM 23 Tue May 29, 2018 9:31 am
No new posts Repeat Sequence Number Until change i... rahulabvp DFSORT/ICETOOL 6 Thu Mar 29, 2018 12:51 pm
No new posts add sequence number for duplicate rec... SRUTHI DRAVIDAMANI COBOL Programming 11 Thu Feb 22, 2018 5:37 pm
No new posts Suppress value reported by BREAK in D... Learncoholic DFSORT/ICETOOL 3 Wed Aug 16, 2017 6:03 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us