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
 

 

Write sign numeric value in readable format

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CA Products
View previous topic :: :: View next topic  
Author Message
chetanambi

New User


Joined: 21 Jan 2012
Posts: 58
Location: India

PostPosted: Tue Feb 19, 2013 5:06 pm    Post subject: Write sign numeric value in readable format
Reply with quote

Hi All,

I am trying to write some of the selected selected fields from the input file to an output file. I have defined input and output layout as below:

Input layout
Code:

FILE INPTFILE                 
 INPT-REC             1 200 A 
 INPT-DIV             1   2 N 
 INPT-CUST            3  16 N 
 INPT-ACCT-TYPE      19   2 N 
 INPT-RETAIL-DIV     21   2 N 
 INPT-TRAS-DATE      23   7 N 
 INPT-LOC            30   4 N 
 INPT-TERMINAL       34   7 N 
 INPT-TRANSACTION    41   7 N 
 INPT-TOT-AMT        84   9 N 2
 INPT-DEPT          104   3 N 
 INPT-CLASS         107   2 N 
 INPT-LINE-ITEM-AMT 109   9 N 2
 INPT-DISCOUNT      118   7 N 2
 INPT-TAX-DISCOUNT  125   7 N 2
 INPT-MARKDN-AMT    132   9 N 2
 INPT-ASSOC-ID      148   8 N 
 INPT-NEW-LOC       192   4 A 


Output layout:
Code:

OUTP-REC             1 200 A 
OUTP-DIV             1   2 N 
OUTP-CUST            4  16 N 
OUTP-ACCT-TYPE      21   2 N 
OUTP-RETAIL-DIV     24   2 N 
OUTP-TRAS-DATE      27   7 N 
OUTP-LOC            35   4 N 
OUTP-NEW-LOC        40   4 A 
OUTP-TERMINAL       45   7 N 
OUTP-TRANSACTION    53   7 N 
OUTP-TOT-AMT        61   9 N 2
OUTP-DEPT           71   3 N 
OUTP-CLASS          75   2 N 
OUTP-LINE-ITEM-AMT  78   9 N 2
OUTP-DISCOUNT       88   7 N 2
OUTP-TAX-DISCOUNT   96   7 N 2
OUTP-MARKDN-AMT    104   9 N 2
OUTP-ASSOC-ID      114   8 N 


in the main logic i am just moving input varaible to output fields like below:
Code:

OUTP-DIV           =   INPT-DIV           
OUTP-CUST          =   INPT-CUST         
OUTP-ACCT-TYPE     =   INPT-ACCT-TYPE     
OUTP-RETAIL-DIV    =   INPT-RETAIL-DIV   
OUTP-TRAS-DATE     =   INPT-TRAS-DATE     
OUTP-LOC           =   INPT-LOC           
OUTP-NEW-LOC       =   INPT-NEW-LOC       
OUTP-TERMINAL      =   INPT-TERMINAL     
OUTP-TRANSACTION   =   INPT-TRANSACTION   
OUTP-TOT-AMT       =   INPT-TOT-AMT       
OUTP-DEPT          =   INPT-DEPT         
OUTP-CLASS         =   INPT-CLASS         
OUTP-LINE-ITEM-AMT =   INPT-LINE-ITEM-AMT
OUTP-DISCOUNT      =   INPT-DISCOUNT     
OUTP-TAX-DISCOUNT  =   INPT-TAX-DISCOUNT 
OUTP-MARKDN-AMT    =   INPT-MARKDN-AMT   
OUTP-ASSOC-ID      =   INPT-ASSOC-ID     
PUT OUTPFILE                             


But in the output file I am not getting data in proper format for signed numeric fields as below.
Code:

402 000007536 303 05 00000532M 0001065 0000000 00000425R 00000201
918 000070525 284 15 00006500} 0009750 0000829 00005525} 00000201
905 000007967 121 14 00000219Q 0000440 0000126 00000175Q 00000201


In the above 532M indicates total amount (TOT-AMT).

I tried with MASK option but still not getting desired resutls. Please help me out.
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Tue Feb 19, 2013 5:16 pm    Post subject: Reply to: Write sign numeric value in readable format
Reply with quote

Easytrieve Plus MASKs are only used for DISPLAY and PRINT.

All fields defined with implied decimal places, like 9 N 2, the 2 is two decimal places, are signed.

You are "getting data in proper format for signed numeric fields". That is what signed fields look like on a file.

If you look here you'll find out what the M in 532M means.
Back to top
View user's profile Send private message
chetanambi

New User


Joined: 21 Jan 2012
Posts: 58
Location: India

PostPosted: Tue Feb 19, 2013 5:32 pm    Post subject:
Reply with quote

Hi Bill,

Thanks for the quick response..

Yes.. If I display that amount field it will be 53.240 and also in file-aid. I want this -53.24 to be written to ouput file as well. Is there any possibilit? Even if you can give hint I would love to find out icon_smile.gif
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Tue Feb 19, 2013 5:50 pm    Post subject: Reply to: Write sign numeric value in readable format
Reply with quote

Well, since you're keen:

This post references a CA-supplied macro which converts in the "other direction", so maybe see if they supply something which does what you want, or look at the macro and write your own for this conversion.

Another way is to write a simple Cobol program which will be defined as a "PRINTER EXIT", that is, specify it as an "EXIT" for a PRINTER file. You DISPLAY the field with the required MASK, and the COBOL program, instead of writing to a file, just returns the value which was edited by Easytrieve Plus.

EDIT:

An example PRINTER EXIT is now here.
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 -> CA Products All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am
No new posts Validate if a Value from the file is ... balacsv2 COBOL Programming 8 Mon Jun 19, 2017 11:52 pm
No new posts Need to write record of PS File in ex... Chandan1993 JCL & VSAM 1 Wed Jun 07, 2017 1:35 am
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm


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