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

Add numeric-edited fields in JCL


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

New User


Joined: 22 Mar 2007
Posts: 57
Location: India

PostPosted: Tue Oct 16, 2012 5:15 pm
Reply with quote

I am in need to add numeric-edited fields via JCL.

Input:
Code:
11111  $   1,111,11.11     
11111  $   2,222,22.22     
22222  $   3,333,33.33     
22222  $   4,444,44.44     
33333  $   5,555,55.55     


Expected output:
Code:
11111  $   3,333,33.33     
22222  $   7,777,77.77     
33333  $   5,555,55.55     


For numeric input, I would have used,
Code:
      OPTION ZDPRINT       
      SORT FIELDS=(1,5,CH,A)
      SUM FIELDS=(9,14,ZD) 


I am not sure about handling numeric-edited field. Can someone please help?
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Tue Oct 16, 2012 5:46 pm
Reply with quote

Sorry, but JCL does not do arithmetic - check the JCL Language Reference Manual.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue Oct 16, 2012 5:55 pm
Reply with quote

Get out your manual and look up field formats. You should find UFF (unsigned free format) which should be a definition of what you want.

If you can't use UFF in SUM (your docs will tell you) you'd have to convert it first.

To get the output back into your format, use an EDIT.
Back to top
View user's profile Send private message
Phrzby Phil

Senior Member


Joined: 31 Oct 2006
Posts: 1042
Location: Richmond, Virginia

PostPosted: Tue Oct 16, 2012 6:22 pm
Reply with quote

I do not see how we can keep telling folks that JCL does not do this or do that, but then have all questions for one of the sort programs go the the JCL section.

Why is there not a special section for either all or each sort program(s)?

This has been on my mind for years. Whew - glad to finally get it out!
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Tue Oct 16, 2012 6:45 pm
Reply with quote

It varies from forum to forum - one has a section title DFSORT but the sub-heading includes SYNCSORT - another has one for each - by far the best arrangement.

But this is the 'experts' forum and they should be able to type sort control cards instead of JCL. Mind you, 'cards' is a bit of a mis-nomer! Should be records/data/info.
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Tue Oct 16, 2012 10:24 pm
Reply with quote

Deepakgoyal2005,

Use the following DFSORT JCL which will give you the desired results
Code:

//STEP0100 EXEC PGM=SORT                         
//SYSOUT   DD SYSOUT=*                           
//SORTIN   DD *                                   
11111  $   1,111,11.11                           
11111  $   2,222,22.22                           
22222  $   3,333,33.33                           
22222  $   4,444,44.44                           
33333  $   5,555,55.55                           
//SORTOUT  DD SYSOUT=*                           
//SYSIN    DD *                                   
  INREC OVERLAY=(81:9,14,UFF,PD,LENGTH=7)         
  SORT FIELDS=(1,5,CH,A)                         
  SUM FIELDS=(81,7,PD)                           
  OUTREC BUILD=(1,8,81,7,PD,EDIT=(III,III,III.TT))
//*
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 Issues Converting From ZD to Signed N... DFSORT/ICETOOL 4
No new posts Convert HEX to Numeric DB2 3
No new posts Find a record count/numeric is multip... COBOL Programming 1
No new posts Concatenate 2 fields (usage national)... COBOL Programming 2
No new posts Cobol COMP-2 fields getting scrambled... Java & MQSeries 6
Search our Forums:

Back to Top