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 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 SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Incorrect output when trying to add n... monica1 PL/I & Assembler 10 Fri Jan 13, 2017 5:02 pm
No new posts HALDB data refresh/copy from producti... vineetanand2007 IMS DB/DC 1 Mon Jan 02, 2017 11:16 am
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am


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