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

Subtract a constant from a numeric field using DFSORT


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
kalukakkad

New User


Joined: 10 Mar 2005
Posts: 81

PostPosted: Wed Oct 11, 2006 7:04 pm
Reply with quote

Hi,

I need to Subtract 1000 from a numeric field in the file.

e.g.

File Layout

ABCD1234
ADGH2345....

my output should be
ABCD0234
ADGH1345

how can i do this using DFSORT.
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: Wed Oct 11, 2006 8:38 pm
Reply with quote

You didn't say what format you wanted for the output, so I'll assume it's ZD. Here's a DFSORT job that will do what you asked for.

Code:

//S1    EXEC  PGM=ICEMAN                             
//SYSOUT    DD  SYSOUT=*                             
//SORTIN DD *                                       
ABCD1234                                             
ADGH2345                                             
/*
//SORTOUT DD SYSOUT=*                               
//SYSIN    DD    *                                   
  OPTION COPY                                       
  INREC OVERLAY=(5:5,4,ZD,SUB,+1000,TO=ZD,LENGTH=4) 
/*
Back to top
View user's profile Send private message
kalukakkad

New User


Joined: 10 Mar 2005
Posts: 81

PostPosted: Thu Oct 12, 2006 8:58 pm
Reply with quote

Thanks Frank, but the output is coming as

ABCD023D
DEFR134E

whereas it should be...
ABCD0234
ADGH1345

how to format it
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: Thu Oct 12, 2006 9:58 pm
Reply with quote

The job gives the correct output with DFSORT since DFSORT uses an F sign for TO=ZD or TO=ZDF and a C sign for TO=ZDC. So you must be using Syncsort which gives a C sign for TO=ZD. 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
kalukakkad

New User


Joined: 10 Mar 2005
Posts: 81

PostPosted: Sat Oct 14, 2006 1:37 am
Reply with quote

Thanks Frank, sorry for raising the question in the wrong forum, but your replies did help me get the result using some syncsort formatting.
Back to top
View user's profile Send private message
kalukakkad

New User


Joined: 10 Mar 2005
Posts: 81

PostPosted: Sat Oct 14, 2006 1:39 am
Reply with quote

i used M11 formatting

//SYSIN DD *
OPTION COPY
INREC OVERLAY=(1:1,4,5:5,4,ZD,SUB,+1000,M11,LENGTH=4)
/*
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 Issues Converting From ZD to Signed N... DFSORT/ICETOOL 4
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts DFsort help with SUM() DFSORT/ICETOOL 12
Search our Forums:

Back to Top