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

Add and Substract in one SORT step


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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 Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Oct 06, 2009 8:59 pm
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
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 Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Oct 06, 2009 9:13 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Return codes-Normal & Abnormal te... JCL & VSAM 7
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
Search our Forums:

Back to Top