Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

2 or more Consecutive records having same value

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

New User


Joined: 17 Feb 2007
Posts: 47
Location: USA

PostPosted: Mon Mar 01, 2010 7:42 pm    Post subject: 2 or more Consecutive records having same value
Reply with quote

Hi,

I got a requirement to get 2 or more Consecutive records having value '9' on position 16. For example in below data I need only the records that are highlighted in blue. I do not need other data as some of them still contain value '9' on position 16 but there is not another '9' record following.

Total file length is 652 FB. There is no Key on this file. I just need 2 or more Consecutive records having value '9' on position 16. INCLUDE COND is not working as it gets ALL '9' records. Please let me know if this can be done using DFSORT/ICETOOL.

INPUT:


CEF PENS01001311
CEF PENS01001311MRO
CEF PENS01001319Z
ABC PENS01001311SBD
ABC PENS01001311SBD
ABC PENS01001319Z
ABC PENS01003311CO
ABC PENS01003319Z
ABC PENS01003319Z

ABC PENS22207321PENS

OUTPUT:

ABC PENS01003319Z
ABC PENS01003319Z

Thanks
Back to top
View user's profile Send private message

Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Mon Mar 01, 2010 10:00 pm    Post subject:
Reply with quote

Ajayreddy,

The following DFSORT JCL will give you the desired results

Code:

//STEP0100 EXEC PGM=SORT     
//SYSOUT   DD SYSOUT=*       
//SORTIN   DD DSN=Your input Fb 652 file,DISP=SHR
//SORTOUT  DD SYSOUT=*                                             
//SYSIN    DD *                                                     
  SORT FIELDS=COPY                                                 
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(653:SEQNUM,8,ZD,RESTART=(16,1))),
  IFTHEN=(WHEN=GROUP,BEGIN=(653,8,ZD,EQ,1,AND,16,1,ZD,EQ,9),       
  PUSH=(661:1,652),RECORDS=2)                                       
  OUTFIL INCLUDE=(653,8,ZD,EQ,2,AND,16,1,ZD,EQ,9),                 
  BUILD=(661,652,/,001,652)                                         
//*
Back to top
View user's profile Send private message
raj12vel

New User


Joined: 20 Dec 2008
Posts: 43
Location: New Jersey

PostPosted: Tue Mar 02, 2010 12:35 pm    Post subject:
Reply with quote

Hi,

I am not able to run the above cards using sort. But it worked fine in ICEMAN.

Thanks
Raj
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Tue Mar 02, 2010 12:45 pm    Post subject:
Reply with quote

raj12vel wrote:
I am not able to run the above cards using sort. But it worked fine in ICEMAN.

Perhaps if you posted the output from the failed process the DFSORT guys can let you know why.
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Tue Mar 02, 2010 2:47 pm    Post subject:
Reply with quote

raj12vel wrote:
Hi,

I am not able to run the above cards using sort. But it worked fine in ICEMAN.

Thanks
Raj

Possibly by calling SORT, DFSORT is not invoked but may be some other sort product which is also available at your shop.

Can you please post error messanges with error codes you are getting?
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Tue Mar 02, 2010 9:40 pm    Post subject:
Reply with quote

Quote:
I am not able to run the above cards using sort. But it worked fine in ICEMAN.


If DFSORT is installed correctly at your site, then PGM=SORT and PGM=ICEMAN would both use DFSORT.

You need to explain what you mean by "I am not able to run the above cards using sort". Show the job you used and the messages you received from the successful and "failing" jobs.
Back to top
View user's profile Send private message
raj12vel

New User


Joined: 20 Dec 2008
Posts: 43
Location: New Jersey

PostPosted: Thu Mar 04, 2010 9:38 am    Post subject:
Reply with quote

Hi Frank,

Sorry for the delay!!! Its my mistake only... its working fine in both PGM=SORT and PGM=ICEMAN

But please educate me on this why i am getting the below statements.
Code:

//STEP01   EXEC PGM=SORT                           
//SYSPRINT  DD SYSOUT=*                             
//SYSOUT   DD SYSOUT=*                             
//SORTIN   DD DSN=input ,DISP=SHR   
//SORTOUT  DD DSN=output ,             
//            DISP=(NEW,CATLG,DELETE),             
//            UNIT=SYSDA,SPACE=(CYL,(200,200),RLSE),
//            DCB=(LRECL=652,RECFM=F,DSORG=PS)     
//SYSIN    DD *                                                   
  SORT FIELDS=COPY                                                 
  INREC IFTHEN=(WHEN=INIT,                                         
                OVERLAY=(653:SEQNUM,8,ZD,RESTART=(16,1))),         
        IFTHEN=(WHEN=GROUP,                                       
                BEGIN=(653,8,ZD,EQ,1,AND,16,1,ZD,EQ,9),           
                PUSH=(661:1,652),RECORDS=2)                       
  OUTFIL INCLUDE=(653,8,ZD,EQ,2,AND,16,1,ZD,EQ,9),                 
         BUILD=(661,652,/,001,652)                                 
JCK2222E INREC (LINE=04): INIT, NONE, ANY OR LOGICAL EXPRESSION IS
         EXPECTED AFTER WHEN=                                     
JCK2222E INREC (LINE=05): PARSE, BUILD OR OVERLAY IS EXPECTED AFTER
         GROUP,                                                   
JCK2218E INREC (LINE=05): INVALID NUMBER (P OR M) IS SPECIFIED     
JCK2218E INREC (LINE=05): INVALID NUMBER (P OR M) IS SPECIFIED     
JCK2218E INREC (LINE=05): INVALID NUMBER (P OR M) IS SPECIFIED     
JCK2218E INREC (LINE=05): INVALID NUMBER (P OR M) IS SPECIFIED     
JCK2245E INREC (LINE=05): COMMA AFTER BEGIN CLAUSE CANNOT BE USED 
         TOGETHER WITH GROUP CLAUSE                               
JCK2201E PUSH IS AN INVALID STATEMENT (LINE=06)       
           


but when i use PGM=ICEMAN, I didnt get those error msgs...
Code:

//STEP01   EXEC PGM=ICEMAN                         
//SYSPRINT  DD SYSOUT=*                             
//SYSOUT   DD SYSOUT=*                             
//SORTIN   DD DSN=input,DISP=SHR   
//SORTOUT  DD DSN=output,             
//            DISP=(NEW,CATLG,DELETE),             
//            UNIT=SYSDA,SPACE=(CYL,(200,200),RLSE),
//            DCB=(LRECL=652,RECFM=F,DSORG=PS)
//SYSIN    DD *                                           
  SORT FIELDS=COPY                                       
  INREC IFTHEN=(WHEN=INIT,                               
                OVERLAY=(653:SEQNUM,8,ZD,RESTART=(16,1))),
        IFTHEN=(WHEN=GROUP,                               
                BEGIN=(653,8,ZD,EQ,1,AND,16,1,ZD,EQ,9),   
                PUSH=(661:1,652),RECORDS=2)               
  OUTFIL INCLUDE=(653,8,ZD,EQ,2,AND,16,1,ZD,EQ,9),       
         BUILD=(661,652,/,001,652)                       
//*                                                         


but both worked fine.

Thanks,
Raj
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Mar 04, 2010 9:53 am    Post subject:
Reply with quote

Hello,

I suspect the JCK* messages are from some "JCL Checker". These products are often behind the capability of the sort product.

When SORT was detected, it tried to validate the sort control statements, but when ICEMAN was the PGM=, the JCL check was not performed for the sort control statements - only the actual JCL.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Thu Mar 04, 2010 11:00 pm    Post subject:
Reply with quote

Raj,

Hmmm ... it appears that the brain-dead JCL Checker at your site thinks that PGM=SORT should be checked but PGM=ICEMAN shouldn't. Not too bright considering that they invoke the same program.

As Dick says, these JCL Checkers are too often not up-to-date on DFSORT syntax.

Talk to your System Programmers about NOT using the JCL Checker for PGM=SORT or PGM=ICEMAN since it obviously can't handle DFSORT's syntax correctly.
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 Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am
No new posts Extract set of records matching on ac... bhaskar_kanteti DFSORT/ICETOOL 3 Mon Mar 06, 2017 7:19 am
No new posts Inserting records based on conditions vickey_dw DFSORT/ICETOOL 9 Wed Feb 22, 2017 1:33 pm
No new posts To Merge mutliple records into a sing... anandgbe DFSORT/ICETOOL 6 Wed Feb 22, 2017 8:49 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us