IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

2 or more Consecutive records having same value


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
AJAYREDDY

New User


Joined: 17 Feb 2007
Posts: 52
Location: USA

PostPosted: Mon Mar 01, 2010 7:42 pm
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
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
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: 8797
Location: Welsh Wales

PostPosted: Tue Mar 02, 2010 12:45 pm
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
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 Developer


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

PostPosted: Tue Mar 02, 2010 9:40 pm
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
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

Moderator Emeritus


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

PostPosted: Thu Mar 04, 2010 9:53 am
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 Developer


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

PostPosted: Thu Mar 04, 2010 11:00 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Join multiple records using splice DFSORT/ICETOOL 5
Search our Forums:

Back to Top