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 and Substract in one SORT step

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
kedianirmal

New User


Joined: 08 Feb 2008
Posts: 82
Location: Bangalore, India

PostPosted: Tue Oct 06, 2009 7:33 pm    Post subject: Add and Substract in one SORT step
Reply with quote

Hi,

I want to add and substract a value in SORT to a given input.

Input file:
Code:
291 091005 06/10/2009 01:00


Expected Output file: i.e. substracting and adding 10 to the first 3 byte 291
Code:
281         301


I am able to add or substract only at once.
Sort Parm Used:
Code:
 SORT FIELDS=COPY                   
   OUTREC FIELDS=(1:1,3,ZD,ADD,+10) 


Is it possible to perform the above task in one step. Please help.

Thanks
Nirmal
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: Tue Oct 06, 2009 8:59 pm    Post subject:
Reply with quote

You can use these DFSORT control statements to do what you asked for:

Code:

  SORT FIELDS=COPY
  OUTREC BUILD=(1:1,3,ZD,SUB,+10,TO=ZD,LENGTH=3,       
   13:1,3,ZD,ADD,+10,TO=ZD,LENGTH=3)                   
Back to top
View user's profile Send private message
kedianirmal

New User


Joined: 08 Feb 2008
Posts: 82
Location: Bangalore, India

PostPosted: Tue Oct 06, 2009 9:07 pm    Post subject:
Reply with quote

Thanks Frank,

Its doing the addition and substraction but the output has A instead of 1.
Code:
28A         30A


could you please help with this.
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: Tue Oct 06, 2009 9:13 pm    Post subject:
Reply with quote

The job works fine with DFSORT which uses F for the TO=ZD sign. You must be using Syncsort, which uses C for the ZD sign.

This is the DFSORT Forum for DFSORT questions. Please post Syncsort questions in the JCL Forum.

I'm a DFSORT developer. DFSORT and Syncsort are competitive products. I'm happy to answer questions on DFSORT and DFSORT's ICETOOL, but I don't answer questions on Syncsort.
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 -> JCL & VSAM 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 change 'K' or 'M' use Sort vice_versa DFSORT/ICETOOL 5 Thu May 18, 2017 7:11 am
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
This topic is locked: you cannot edit posts or make replies. SORT trick needed bshkris SYNCSORT 6 Tue May 02, 2017 4:35 am
No new posts SORT JSON type of data maxsubrat DFSORT/ICETOOL 8 Wed Apr 19, 2017 6:01 pm


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