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
 

 

Subtract a constant from a numeric field using DFSORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Subtract a constant from a numeric field using DFSORT
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 Moderator


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

PostPosted: Wed Oct 11, 2006 8:38 pm    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Thu Oct 12, 2006 9:58 pm    Post subject:
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    Post subject:
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    Post subject:
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    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 SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm
No new posts outrec field outside range Danielle.Filteau SYNCSORT 10 Sat Mar 04, 2017 2:37 am
No new posts DFSORT MUL FIELDS tspr52 DFSORT/ICETOOL 16 Fri Mar 03, 2017 11:53 pm
No new posts 2 byte YEAR from Y'DATE2' field tecnokrat DFSORT/ICETOOL 2 Tue Feb 07, 2017 12:05 pm


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