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
 

 

Add numeric-edited fields in JCL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Add numeric-edited fields in JCL
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: 1722
Location: UK

PostPosted: Tue Oct 16, 2012 5:46 pm    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7251

PostPosted: Tue Oct 16, 2012 5:55 pm    Post subject: Reply to: Add numeric-edited fields in JCL
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

Active Member


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

PostPosted: Tue Oct 16, 2012 6:22 pm    Post subject:
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: 1722
Location: UK

PostPosted: Tue Oct 16, 2012 6:45 pm    Post subject:
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    Post subject: Reply to: Add numeric-edited fields in JCL
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    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 Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am
No new posts Access SQLCA fields inside a stored p... gangapd DB2 4 Thu Oct 27, 2016 10:20 am
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts Casting a Binary Number to Numeric in... Bob Steinkraus Java & MQSeries 6 Tue Aug 09, 2016 5:58 pm
This topic is locked: you cannot edit posts or make replies. Alphanumeric to Numeric move on UNIX mistah kurtz COBOL Programming 16 Wed Jul 27, 2016 8:47 pm


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