Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
subtract and copy to output.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: subtract and copy to output.
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    Post subject: Reply to: subtract and copy to output.
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    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 Copy set of records based on condition krish.deepu SYNCSORT 2 Thu Mar 08, 2018 11:39 am
No new posts How to get the output from submit com... Joanna2016 CLIST & REXX 10 Tue Feb 06, 2018 7:26 am
No new posts Image copy after Online reorganization. lind sh IMS DB/DC 0 Tue Jan 30, 2018 9:58 pm
No new posts Copy Specific Groups V S Amarendra Reddy SYNCSORT 10 Thu Jan 11, 2018 1:16 am
No new posts Compare and COPY using DFSORT pshongal DFSORT/ICETOOL 3 Fri Nov 17, 2017 9:49 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us