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 Innovations in Your Mainframe Sort Arun Raj PC Guides & IT News 4 Wed Mar 15, 2017 10:38 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts SORT requirement sjiraga COBOL Programming 6 Thu Mar 09, 2017 9:11 pm
No new posts SORT to append Month and YEAR in MMYY... tisamf DFSORT/ICETOOL 1 Wed Mar 08, 2017 4:46 pm
No new posts JCL sort Match and NoMatch rakeshsekar1987 SYNCSORT 2 Thu Feb 02, 2017 10:26 pm


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