How to add decimal in JCL sort card



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

How to add decimal in JCL sort card

Postby vgupta54 » Fri Apr 17, 2009 7:29 pm

I have the input file in character format as shown below.
EID PNO
101 10.56
101 10.74
102 34.34
102 45.34

I want the output as
EID PNO
101 21.30 Sum for 101
101 10.56
101 10.74
102 79.68 Sum for 102
102 34.34
102 45.34

1st line is the output for common 1st empid as for 101 etc.
vgupta54
 
Posts: 7
Joined: Fri Apr 17, 2009 11:45 am
Has thanked: 0 time
Been thanked: 0 time

Re: How to add decimal in JCL sort card

 

Re: How to add decimal in JCL sort card

Postby Frank Yaeger » Fri Apr 17, 2009 8:30 pm

You can use a DFSORT/ICETOOL job like the following to do what you asked for. I assumed your input file has RECFM=FB and LRECL=80, but the job can be changed appropriately for other attributes.

//S1   EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN DD *
101 10.56
101 10.74
102 34.34
102 45.34
/*
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//OUT DD SYSOUT=*
//TOOLIN DD *
COPY FROM(IN) USING(CTL1)
SORT FROM(T1) TO(OUT) USING(CTL2)
/*
//CTL1CNTL DD *
  INREC OVERLAY=(81:C'1')
  OUTFIL FNAMES=T1,REMOVECC,
   SECTIONS=(1,3,
     TRAILER3=(1,3,5:TOT=(5,5,UFF,EDIT=(IT.TT)),2X,
      'Sum for ',1,3,81:C'0'))
/*
//CTL2CNTL DD *
  OPTION EQUALS
  SORT FIELDS=(1,3,CH,A,81,1,CH,A)
  OUTREC BUILD=(1,80)
/*
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1080
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 14 times

Re: How to add decimal in JCL sort card

Postby vgupta54 » Mon Apr 20, 2009 11:27 am

Thnx....
vgupta54
 
Posts: 7
Joined: Fri Apr 17, 2009 11:45 am
Has thanked: 0 time
Been thanked: 0 time


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post