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
 

 

Help Required - DFSORT - Sorting

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

New User


Joined: 21 Nov 2007
Posts: 19
Location: hyderabad

PostPosted: Thu May 21, 2009 12:41 pm    Post subject: Help Required - DFSORT - Sorting
Reply with quote

Hi Friends,

I have requirement in our project and we have ICEMAN in our project.

Below is structure of input file:

input file structure is - Header will be repeated for every 40 policies- i.e., every page will have 40 policies.- And records are not sorted And in future more states can be added.

POLICY NO STATE AGENCY CODE EFFECTIVE DATE
DP 116038 RI 000104600000 2009-08-16
DP 116242 IA 000101500000 2009-08-17
DP 216038 RI 000104600000 2010-08-16
DP 216242 MN 000101500000 2010-08-17


Required output is - State Column should be Removed- And policies should be grouped by state code.

STATE - RI
POLICY NO AGENCY CODE EFFECTIVE DATE
DP 116038 000104600000 2009-08-16
DP 216038 000104600000 2010-08-16

STATE - IA
POLICY NO AGENCY CODE EFFECTIVE DATE
DP 116242 IA 000101500000 2009-08-17

STATE - MN
POLICY NO AGENCY CODE EFFECTIVE DATE
DP 216242 MN 000101500000 2010-08-17

Is it possible using a JCL/DFSORT or do i need write a cobol code?

Thanks in advance.

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

dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu May 21, 2009 12:44 pm    Post subject:
Reply with quote

Suggest you search the forum, this has been asked and answered repeatedly.

with any luck, the other posters would have used a meaningful title which you decided was not necessary.

Help Required - DFSORT - Sorting as a title for a thread in a SORT forum, the function of the forum being to provide help,
is not very useful for searches.

At least you did not put "urgent".
Back to top
View user's profile Send private message
Surya Kira nPasumarthi

New User


Joined: 21 Nov 2007
Posts: 19
Location: hyderabad

PostPosted: Thu May 21, 2009 12:56 pm    Post subject:
Reply with quote

Hi Dick Brenholtz ,

Thank you very much for the sugesstion, I am very sorry for wasting your time.

I have given 1 min think on the subject, as any thing didnt stuck my brain, I have used help required.

I will make sure, to follow your suggestions from the next time and even i will try to change subject for this tread(i am not sure if it possible or not).

Once again thank you very much and sorry for wasting your time.

Thanks,
SK
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 May 21, 2009 8:51 pm    Post subject:
Reply with quote

Surya,

You can use a DFSORT job like the following to do what you asked for. I assumed the states could be in alphabetical order in the output report.

Code:

//S1    EXEC  PGM=SORT
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *
POLICY NO           STATE   AGENCY CODE         EFFECTIVE DATE
DP   116038         RI      000104600000        2009-08-16
DP   116242         IA      000101500000        2009-08-17
DP   216038         RI      000104600000        2010-08-16
DP   216242         MN      000101500000        2010-08-17
/*
//SORTOUT DD SYSOUT=*
//SYSIN    DD    *
  OMIT COND=(1,6,CH,EQ,C'POLICY')
  OPTION EQUALS
  SORT FIELDS=(21,2,CH,A)
  OUTFIL REMOVECC,
    SECTIONS=(21,2,SKIP=L,
      HEADER3=(1:'STATE - ',21,2,/,
       1:'POLICY NO',18:'AGENCY CODE',38:'EFFECTIVE DATE')),
    BUILD=(1:1,11,18:29,12,38:49,10,80:X)
/*


SORTOUT would have:

Code:

STATE - IA                                                   
POLICY NO        AGENCY CODE         EFFECTIVE DATE           
DP   116242      000101500000        2009-08-17               
                                                             
STATE - MN                                                   
POLICY NO        AGENCY CODE         EFFECTIVE DATE           
DP   216242      000101500000        2010-08-17               
                                                             
STATE - RI                                                   
POLICY NO        AGENCY CODE         EFFECTIVE DATE           
DP   116038      000104600000        2009-08-16               
DP   216038      000104600000        2010-08-16               
Back to top
View user's profile Send private message
Surya Kira nPasumarthi

New User


Joined: 21 Nov 2007
Posts: 19
Location: hyderabad

PostPosted: Thu May 21, 2009 11:27 pm    Post subject:
Reply with quote

Hi Frank,

Thank you very very very much, the soultion you have given is working very fine. I just had two more question,

1. After State we are display RI, IA , MN - but while printing the output, if need to show the expanded form like RI- Rhode Island, IA - IOWA. How can we do that?

2. If there is some piece of header(company name, and some 3-4 lines - Actually i have missed in the above example) and need to display before every state and/or after every 40 policies, how to do that.

I am sorry for posing so many questions, I have never used DFSORT before, this is first i am using it for, a larger requirement. I will make to learn it.


Thanks in advance,
SK
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 May 21, 2009 11:37 pm    Post subject:
Reply with quote

You can display the expanded form using these DFSORT control statements:

Code:

  OMIT COND=(1,6,CH,EQ,C'POLICY')                               
  OPTION EQUALS                                                 
  SORT FIELDS=(21,2,CH,A)                                       
  OUTREC OVERLAY=(81:21,2,CHANGE=(12,C'RI',C'Rhode Island',     
    C'IA',C'Iowa',C'MN',C'Minnesota'),NOMATCH=(C'Unknown'))     
  OUTFIL REMOVECC,                                               
    SECTIONS=(21,2,SKIP=L,                                       
      HEADER3=(1:'STATE - ',81,12,/,                             
       1:'POLICY NO',18:'AGENCY CODE',38:'EFFECTIVE DATE')),     
    BUILD=(1:1,11,18:29,12,38:49,10,80:X)                       


Quote:
2. If there is some piece of header(company name, and some 3-4 lines - Actually i have missed in the above example) and need to display before every state and/or after every 40 policies, how to do that.


HEADER3 is a section header. It will be displayed at the top of every state section. You can put whatever you want in HEADER3. If that doesn't help, then show an example of the output you want.
Back to top
View user's profile Send private message
Surya Kira nPasumarthi

New User


Joined: 21 Nov 2007
Posts: 19
Location: hyderabad

PostPosted: Thu May 21, 2009 11:45 pm    Post subject:
Reply with quote

Input file - 1,2,3,4(SPACES),5 LINES ARE HEADERS

DATE RUN... 08/06/2009 ABC XYZ INC.
VALUATION DATE.08/06/2009 MMM PAGE: 1
ABCD PROCESS REPORT

POLICY NO STATE AGENCY CODE EFFECTIVE DATE
DP 116038 RI 000104600000 2009-08-16
DP 116242 IA 000101500000 2009-08-17
DP 216038 RI 000104600000 2010-08-16
DP 216242 MN 000101500000 2010-08-17

1,2,3,4(SPACES) LINES NEED TO BE DISPLAYED FOR EVERY STATE OR FOR EVERY 40 POLICIES(EACH PAGE CAN HAVE 40 POLICIES + 5 HEADER LINES)
AND Line two has a page number.

Can we achieve this. Thank you very much in advance for the every help.

Thanks,
SK
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: Fri May 22, 2009 1:16 am    Post subject:
Reply with quote

Your description is a bit unclear but I took a shot. I assumed 'DATE RUN' starts in column 1. See if this DFSORT job gives you what you want:

Code:

//S1    EXEC  PGM=SORT
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (FB)
//SORTOUT DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN    DD    *
  OPTION COPY,STOPAFT=3
  INREC IFOUTLEN=80,
   IFTHEN=(WHEN=(1,8,CH,EQ,C'DATE RUN'),
    BUILD=(C'HL1,''',1,45,C'''')),
   IFTHEN=(WHEN=(1,9,CH,EQ,C'VALUATION'),
    BUILD=(C'HL2,''',1,45,C'''')),
   IFTHEN=(WHEN=NONE,
    BUILD=(C'HL3,''',21,45,C''''))
/*
//S2    EXEC  PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)
//SORTIN DD DSN=...  input file (FB)
//SORTOUT DD SYSOUT=*
//SYSIN    DD    *
  OMIT COND=(1,8,EQ,C'DATE RUN',OR,1,9,EQ,C'VALUATION',
    OR,21,45,EQ,HL3,OR,1,20,EQ,C' ',OR,1,6,EQ,C'POLICY'),
   FORMAT=CH
  OPTION EQUALS
  SORT FIELDS=(21,2,CH,A)
  OUTREC OVERLAY=(81:21,2,CHANGE=(12,C'RI',C'Rhode Island',
    C'IA',C'Iowa',C'MN',C'Minnesota'),NOMATCH=(C'Unknown'))
  OUTFIL REMOVECC,
    SECTIONS=(21,2,SKIP=P,
      HEADER3=(1:HL1,/,1:HL2,56:'PAGE:',PAGE=(EDIT=(IIIT)),/,
         21:HL3,/,X,/,
       1:'STATE - ',81,12,/,
       1:'POLICY NO',18:'AGENCY CODE',38:'EFFECTIVE DATE')),
    BUILD=(1:1,11,18:29,12,38:49,10,80:X)
/*


The first two pages of the output would be:

Code:

DATE RUN... 08/06/2009       ABC XYZ INC.                               
VALUATION DATE.08/06/2009       MMM                    PAGE:   1       
                                   ABCD PROCESS REPORT                 
                                                                       
STATE - Iowa                                                           
POLICY NO        AGENCY CODE         EFFECTIVE DATE                     
DP   116242      000101500000        2009-08-17                         
DP   116242      000101500000        2009-08-17                         
DATE RUN... 08/06/2009       ABC XYZ INC.                               
VALUATION DATE.08/06/2009       MMM                    PAGE:   2       
                                   ABCD PROCESS REPORT                 
                                                                       
STATE - Minnesota                                                       
POLICY NO        AGENCY CODE         EFFECTIVE DATE                     
DP   216242      000101500000        2010-08-17                         
DP   216242      000101500000        2010-08-17                         
Back to top
View user's profile Send private message
Surya Kira nPasumarthi

New User


Joined: 21 Nov 2007
Posts: 19
Location: hyderabad

PostPosted: Fri May 22, 2009 9:19 am    Post subject:
Reply with quote

hi frank,

Thank you very much for the generous help, but when i am trying to excute above code. I am facing issue. In the above code, Observed that in the first step sortout is &&S1, but in the second step SYSNAME is &&SYS1. I have fixed this, but the issue still continues.

OUTFIL REMOVECC,
SECTIONS=(16,2,SKIP=P,
HEADER3=(1:HL1,/,1:HL2,56:'PAGE:',PAGE=(EDIT=(IIIT)),/,
$
ICE007A 1 SYNTAX ERROR
21:HL3,/,X,/,
$
ICE007A 0 SYNTAX ERROR
1:'STATE - ',101,14,/, 4,/,
$
ICE007A 0 SYNTAX ERROR
1:'POLICY NO',18:'AGENCY CODE',38:'EFFECTIVE DATE')),
$
ICE007A 0 SYNTAX ERROR
BUILD=(1:1,11,18:29,12,38:49,10,80:X)
$
Back to top
View user's profile Send private message
Surya Kira nPasumarthi

New User


Joined: 21 Nov 2007
Posts: 19
Location: hyderabad

PostPosted: Fri May 22, 2009 9:21 am    Post subject:
Reply with quote

Code:

            OUTFIL REMOVECC,                                                   
              SECTIONS=(16,2,SKIP=P,                                           
                    HEADER3=(1:HL1,/,1:HL2,56:'PAGE:',PAGE=(EDIT=(IIIT)),/,     
                               $                                               
ICE007A 1 SYNTAX ERROR                                                         
                       21:HL3,/,X,/,                                           
                       $                                                       
ICE007A 0 SYNTAX ERROR                                                         
                     1:'STATE - ',101,14,/, 4,/,                               
                     $                                                         
ICE007A 0 SYNTAX ERROR                                                         
                     1:'POLICY NO',18:'AGENCY CODE',38:'EFFECTIVE DATE')),     
                     $                                                         
ICE007A 0 SYNTAX ERROR                                                         
                  BUILD=(1:1,11,18:29,12,38:49,10,80:X)                         
                  $                                                             
ICE005A 0 STATEMENT DEFINER ERROR                                               
ICE751I 0 C5-K26318 C6-K90007 C7-K90000 C8-K23476 E7-K24705                     
ICE052I 3 END OF DFSORT                                                         
Back to top
View user's profile Send private message
Surya Kira nPasumarthi

New User


Joined: 21 Nov 2007
Posts: 19
Location: hyderabad

PostPosted: Fri May 22, 2009 9:23 am    Post subject:
Reply with quote

length of the input file is LRECL = 133
Code:

//PASISORT  JOB (0136T,GLAS),'PASUM FMR L',NOTIFY=&SYSUID,         
//          MSGLEVEL=(1,1),MSGCLASS=X,CLASS=A                       
//**************************************************************** 
//STEP1  EXEC  PGM=SORT                                             
//*                                                                 
//SYSOUT   DD  SYSOUT=*                                             
//*                                                                 
//SORTIN   DD    DISP=SHR,                                         
//         DSN=SAYERA1.INPUT.REPORT1                               
//*                                                                 
//SORTOUT  DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)   
/*                                                                 
//SYSIN    DD    *                                                 
  OPTION COPY,STOPAFT=4 'DATE',OR,                                 
    INREC IFOUTLEN=80, C' ',OR,                                     
     IFTHEN=(WHEN=(4,8,CH,EQ,C'DATE RUN'),                         
      BUILD=(C'HL1,''',1,100,C'''')),                               
     IFTHEN=(WHEN=(4,9,CH,EQ,C'VALUATION'),                         
      BUILD=(C'HL2,''',1,100,C'''')),                             
     IFTHEN=(WHEN=(38,7,CH,EQ,C'CAPPING'),                         
      BUILD=(C'HL3,''',1,100,C'''')),                             
     IFTHEN=(WHEN=NONE,                                           
      BUILD=(C'HL4,''',1,100,C''''))                               
/*                                                                 
//SYSUT2    DD SYSOUT=*                                           
//****************************************************************
//STEP1  EXEC  PGM=ICEMAN                                         
//*                                                               
//SORTIN   DD    DISP=SHR,                                         
//         DSN=SAYERA1.INPUT.REPORT1                               
//SORTLIB  DD  DSN=SYS1.SORTLIB,DISP=SHR                           
//*                                                               
//SYSOUT   DD  SYSOUT=*                                           
//SYSNAMES DD  DSN=&&S1,DISP=(OLD,PASS)                           
//*                                                               
//SORTOUT  DD SYSOUT=*                                             
//*        DSN=SAYERA1.OUTPUT.REPORT                               
/*                                                         
//SORTWK01 DD    UNIT=SYSDA,SPACE=(CYL,(5,5))             
//SYSIN    DD    *                                         
  OMIT COND=(4,4,CH,EQ,C'DATE',OR,                         
             3,1,CH,EQ,C' ',OR,                           
             4,9,CH,EQ,C'VALUATION',OR,                   
            38,7,CH,EQ,C'CAPPING',OR,                     
             3,6,CH,EQ,C'POLICY',OR,                       
             3,6,CH,EQ,C'------'),                         
        FORMAT=CH                                         
  OPTION EQUALS                                           
  SORT FIELDS=(16,2,CH,A)                                 
  OUTREC OVERLAY=(101:16,2,                               
          CHANGE=(14,C'RI',C'RHODE ISLAND',               
                     C'SC',C'SOUTH CAROLINA',             
                     C'VA',C'VIRGINIA',                   
                     C'IL',C'ILLINOUS',                   
                     C'IA',C'IOWA',                       
                     C'MN',C'MINNESOTA'),                 
                     NOMATCH=(C'UNKNOWN'))                       
  OUTFIL REMOVECC,                                               
    SECTIONS=(16,2,SKIP=P,                                       
          HEADER3=(1:HL1,/,1:HL2,56:'PAGE:',PAGE=(EDIT=(IIIT)),/,
             21:HL3,/,X,/,                                       
           1:'STATE - ',101,14,/, 4,/,                           
           1:'POLICY NO',18:'AGENCY CODE',38:'EFFECTIVE DATE')), 
        BUILD=(1:1,11,18:29,12,38:49,10,80:X)                     
/*                                                               
//SYSUT2    DD SYSOUT=*                                           
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: Fri May 22, 2009 9:32 am    Post subject:
Reply with quote

Hello,

Quote:
Observed that in the first step sortout is &&S1, but in the second step SYSNAME is &&SYS1.
I do not see this in the code Frank posted. . . Neither the &&SYS1 nor the SYSNAME icon_confused.gif Where did you find these? Possibly i have missed this somehow.

Why did you change this:
Code:
SECTIONS=(21,2,SKIP=P,
icon_question.gif

Suggest you try using exactly what was provided. . .
Back to top
View user's profile Send private message
Surya Kira nPasumarthi

New User


Joined: 21 Nov 2007
Posts: 19
Location: hyderabad

PostPosted: Fri May 22, 2009 10:02 am    Post subject:
Reply with quote

Yes... DSCH..i just missed out something.sorry for that. according to the code provided by the frank, the state code is starting in the 21 positon.. So i have changed according to my input file where my State code is state code starts at 16.

Code:

1  DATE RUN.........05/15/2009                      ABC COMPANY
   VALUATION DATE...05/15/2009                 PERSONAL LINES PAGE: 1
                                                                               
0                                    CAPPING WAS APPLIED ON THE FOLLOWING POLICI
                                                                               
0 POLICY NO    STATE   AGENCY CODE    EFFECTIVE DATE   CAP YR  OLD WAY PREMIUM 
  ----------   -----   ------------   --------------   ------  --------------- 
  DP   77238   RI      000144100000   2009-06-25       FIRST         $1,404.00 
  DP  127754   RI      000103600000   2009-06-24       FIRST         $1,244.00 
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: Fri May 22, 2009 10:14 am    Post subject:
Reply with quote

Hello,

Quote:
i just missed out something.sorry for that.
Not a problem icon_smile.gif

Is this now working?

If not, please post the current control info and the diagnostic info.
Back to top
View user's profile Send private message
Surya Kira nPasumarthi

New User


Joined: 21 Nov 2007
Posts: 19
Location: hyderabad

PostPosted: Fri May 22, 2009 10:23 am    Post subject:
Reply with quote

Hi dick scherrer,

Thanks for the help.

In my previous post(bottom second post).. i have included the structure of the input file.

Above that i have included the Present code. Still it is not working fine.

I have tried with the suggest you have made. Still i am facing the same issue.

Attached below the diagnostic info

Code:

ICE143I 0 BLOCKSET     SORT  TECHNIQUE SELECTED                                 
ICE250I 0 VISIT http://www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLES AN
ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R5 - 00:50 ON FRI MAY
            OMIT COND=(4,4,CH,EQ,C'DATE',OR,                                   
                       3,1,CH,EQ,C' ',OR,                                       
                       4,9,CH,EQ,C'VALUATION',OR,                               
                      38,7,CH,EQ,C'CAPPING',OR,                                 
                       3,6,CH,EQ,C'POLICY',OR,                                 
                       3,6,CH,EQ,C'------'),                                   
                  FORMAT=CH                                                     
ICE170I 2 FORMAT OPERAND IGNORED                                               
            OPTION EQUALS                                                     
            SORT FIELDS=(21,2,CH,A)                                           
            OUTREC OVERLAY=(101:16,2,                                         
                    CHANGE=(14,C'RI',C'RHODE ISLAND',                         
                               C'SC',C'SOUTH CAROLINA',                       
                               C'VA',C'VIRGINIA',                             
                               C'IL',C'ILLINOUS',                             
                               C'IA',C'IOWA',                                 
                               C'MN',C'MINNESOTA'),                           
                               NOMATCH=(C'UNKNOWN'))                           
            OUTFIL REMOVECC,                                                   
              SECTIONS=(21,2,SKIP=P,                                           
                    HEADER3=(1:HL1,/,1:HL2,56:'PAGE:',PAGE=(EDIT=(IIIT)),/,   
                               $                                               
ICE007A 1 SYNTAX ERROR                                                         
                       21:HL3,/,X,/,                                           
                       $                                                       
ICE007A 0 SYNTAX ERROR                                                         
                     1:'STATE - ',101,14,/, 4,/,                           
                     $                                                     
ICE007A 0 SYNTAX ERROR                                                     
                     1:'POLICY NO',18:'AGENCY CODE',38:'EFFECTIVE DATE')), 
                     $                                                     
ICE007A 0 SYNTAX ERROR                                                     
                  BUILD=(1:1,11,18:29,12,38:49,10,80:X)                     
                  $                                                         
ICE005A 0 STATEMENT DEFINER ERROR                                           
ICE751I 0 C5-K26318 C6-K90007 C7-K90000 C8-K23476 E7-K24705                 
ICE052I 3 END OF DFSORT                                                     


I am very new to this blog, i am not sure until now how to use effectively post the info. I am learning this, thank you very much for all the help.

Please let me know if you are looking for any more information.
Thanks,
SK
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: Fri May 22, 2009 10:38 am    Post subject:
Reply with quote

Hello,

Your "omit" is a bit different than the one Frank posted. I don't know if this is a problem or not but that is when the first error message is written:
ICE170I 2 FORMAT OPERAND IGNORED

There is also the chance that your software doesn't have the most recent ptf.

I'll be away for a few hours, but someone will be online to follow up.

Good luck icon_smile.gif
Quote:
i am not sure until now how to use effectively post the info
Looks like you're doing ok with it now. . . icon_wink.gif
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: Fri May 22, 2009 9:24 pm    Post subject:
Reply with quote

There are several problems.

First off, in the second step, you have //SYSNAMES instead of //SYMNAMES so your symbols were ignored. Look at my job again and you'll see that I have //SYMNAMES.

Based on the original input you showed, I created the symbols as 45 characters which results in valid symbols. You changed that to create symbols of 100 characters which won't work. The Symbols data set must have RECFM=FB and LRECL=80, so I used IFOUTLEN=80 to set the length to 80. That will truncate your symbols to 80 bytes so they won't be valid. We'll have to break up your symbols so they'll work. Note that for the symbol with the PAGE number, we don't want to include the PAGE number part because we need to generate new page numbers for the new report.

Your fields don't seem to be where I thought they were either. But based on your latest job, I tried to figure out where they were. Here's my best guess at the DFSORT job you need:

Code:

//STEP1  EXEC  PGM=SORT
//SYSOUT   DD  SYSOUT=*
//SORTIN   DD    DISP=SHR,
//         DSN=SAYERA1.INPUT.REPORT1
//SORTOUT  DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN    DD    *
  OPTION COPY,STOPAFT=4
  OUTFIL IFOUTLEN=80,
     IFTHEN=(WHEN=(4,8,CH,EQ,C'DATE RUN'),
      BUILD=(C'HL1A,''',1,50,C'''',/,
             C'HL1B,''',51,50,C'''')),
     IFTHEN=(WHEN=(4,9,CH,EQ,C'VALUATION'),
      BUILD=(C'HL2,''',1,55,C'''')),
     IFTHEN=(WHEN=(38,7,CH,EQ,C'CAPPING'),
      BUILD=(C'HL3A,''',1,50,C'''',/,
             C'HL3B,''',51,50,C'''')),
     IFTHEN=(WHEN=NONE,
      BUILD=(C'HL4A,''',1,50,C'''',/,
             C'HL4B,''',51,50,C''''))
/*
//STEP2  EXEC  PGM=ICEMAN
//SORTIN   DD    DISP=SHR,
//         DSN=SAYERA1.INPUT.REPORT1
//SYSOUT   DD  SYSOUT=*
//SYMNAMES DD  DSN=&&S1,DISP=(OLD,PASS)
//SORTOUT  DD SYSOUT=*
//SYSIN    DD    *
  OMIT COND=(4,4,EQ,C'DATE',OR,
             3,1,EQ,C' ',OR,
             4,9,EQ,C'VALUATION',OR,
            38,7,EQ,C'CAPPING',OR,
             3,6,EQ,C'POLICY',OR,
             3,6,EQ,C'------'),
        FORMAT=CH
  OPTION EQUALS
  SORT FIELDS=(16,2,CH,A)
  OUTREC OVERLAY=(101:16,2,
          CHANGE=(14,C'RI',C'RHODE ISLAND',
                     C'SC',C'SOUTH CAROLINA',
                     C'VA',C'VIRGINIA',
                     C'IL',C'ILLINOUS',
                     C'IA',C'IOWA',
                     C'MN',C'MINNESOTA'),
                     NOMATCH=(C'UNKNOWN'))
  OUTFIL REMOVECC,
    SECTIONS=(16,2,SKIP=P,
          HEADER3=(1:HL1A,HL1B,/,
              1:HL2,56:'PAGE:',PAGE=(EDIT=(IIIT)),/,
              HL3A,HL3B,/,
              HL4A,HL4B,/,X,/,
           1:'STATE - ',101,14,/, 4,/,
           1:'POLICY NO',18:'AGENCY CODE',38:'EFFECTIVE DATE')),
        BUILD=(1:1,11,18:29,12,38:49,10,133:X)
/*


If it doesn't work, then either you changed something or copied it incorrectly, or I guessed wrong about the positions of your fields.
Back to top
View user's profile Send private message
Surya Kira nPasumarthi

New User


Joined: 21 Nov 2007
Posts: 19
Location: hyderabad

PostPosted: Thu Jun 11, 2009 8:50 pm    Post subject:
Reply with quote

Hi Frank,

Thank you very much, I am able sucesfully implement the code. I am able to run the JCL.

I am getting the required output. All that i have done is changed the positions of the fields a bit. Thank you very much.

It is working fine as per the requirement. Expect that it should print the header if the policies under one state is more than 45.

I.e., it is printing the header for every state and changing the page number if the number of policies is more... but it is not printing the header.

How to include that condition.. thank you very much.
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 How to get the remainder and quotient... vnktrrd DFSORT/ICETOOL 2 Mon Oct 31, 2016 10:59 am
No new posts Efficient sorting chandracdac DFSORT/ICETOOL 5 Sat Oct 22, 2016 3:23 am
No new posts Stripping and Sorting of VB file G SRINIVASA RAO SYNCSORT 5 Wed Sep 14, 2016 1:34 pm
No new posts Change date (DD/MM/YY) in 2nd record ... uday kiran DFSORT/ICETOOL 12 Wed Sep 07, 2016 10:57 pm
No new posts DFSORT sorting only specific records akodakka DFSORT/ICETOOL 4 Thu Aug 04, 2016 11:24 am


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