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 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
No new posts VBS and VB, COBOL syntax is the same ... natt.sut COBOL Programming 3 Sun Nov 12, 2017 6:36 am
No new posts Copy selected columns from 2 input fi... Poha Eater DFSORT/ICETOOL 3 Thu Nov 02, 2017 3:43 pm
No new posts Subtract the ZD fields to provide neg... Balaryan DFSORT/ICETOOL 4 Wed Oct 11, 2017 10:51 pm

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