|
View previous topic :: View next topic
|
| Author |
Message |
AJAYREDDY
New User
Joined: 17 Feb 2007 Posts: 52 Location: USA
|
|
|
|
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 |
|
 |
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
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 |
|
 |
raj12vel
New User
Joined: 20 Dec 2008 Posts: 43 Location: New Jersey
|
|
|
|
Hi,
I am not able to run the above cards using sort. But it worked fine in ICEMAN.
Thanks
Raj |
|
| Back to top |
|
 |
expat
Global Moderator

Joined: 14 Mar 2007 Posts: 8798 Location: Welsh Wales
|
|
|
|
| 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 |
|
 |
Escapa
Senior Member

Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
| 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 |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
| 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 |
|
 |
raj12vel
New User
Joined: 20 Dec 2008 Posts: 43 Location: New Jersey
|
|
|
|
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 |
|
 |
dick scherrer
Moderator Emeritus

Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
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 |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|