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

subtract and copy to output.


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

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Wed Feb 11, 2009 6:43 pm
Reply with quote

Hi,

I have an input dataset that contains numeric fields in positions 30 and 40. I wans to subtract field 40 from field 30 and put the result in column 50. The field 30 may contain zeros.

Input:
Code:

----+----1----+----2----+----3----+----4----+----5
                             00204     00100     
                             01444     00505     
                             00793     00128     
                             01640     00980     
                             10106     09105     


Below is the code I used and would like to know why subtracted value appears at 62nd column instead of 50th column !!!

Code:

//JOB00001 EXEC PGM=SORT                       
//SORTIN   DD *                               
                             00204     00100   
                             01444     00505   
                             00793     00128   
                             01640     00980   
                             10106     09105   
//SORTOUT  DD SYSOUT=*                         
//SYSOUT   DD SYSOUT=*                         
//SYSIN    DD *                               
  OPTION COPY                                 
  OUTREC FIELDS=(50:30,5,ZD,SUB,40,5,ZD,80:X) 



Thanks.
Back to top
View user's profile Send private message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Wed Feb 11, 2009 7:18 pm
Reply with quote

Ok folks........I got it right now.

Code:

//SYSIN    DD *                                           
  OPTION COPY                                             
  OUTREC FIELDS=(50:30,5,ZD,SUB,40,5,ZD,M11,LENGTH=5,80:X)


I had to add the M11 & LENGTH=N to achieve it.

Thanks. icon_biggrin.gif
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 Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts VB to VB copy - Full length reached SYNCSORT 8
No new posts Joinkeys - 5 output files DFSORT/ICETOOL 7
No new posts Build a record in output file and rep... DFSORT/ICETOOL 11
No new posts XDC SDSF output to temp dataset CLIST & REXX 4
Search our Forums:

Back to Top