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

How to eliminate the commas in easy trieve program


IBM Mainframe Forums -> CA Products
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
av_sukumar

New User


Joined: 12 Oct 2004
Posts: 6

PostPosted: Tue Sep 04, 2007 9:18 pm
Reply with quote

Hi,

Could any one please let me know the solution for the below problem.

My requirement is to add the gross field of all the records exists in
a file. But this file is again a report file from a program and the gross
filed in this one has commas, for example 2,000.00.

When I am trying to add the gross filed then easy trieve is not working
because of commas it is abending. So, could any one tell me how to
eliminate the commas in easytrive program or tell me is there any better
way the above can be done.

Your quick reply will be appreciated. Thank you.
Back to top
View user's profile Send private message
Douglas Wilder

Active User


Joined: 28 Nov 2006
Posts: 305
Location: Deerfield IL

PostPosted: Sat Sep 08, 2007 4:02 am
Reply with quote

The easier way is to modify the previous program to write a file without the commas or have the previous program write both reports.

If you can not do that something like this may work for you.
Code:
*------ FIELD LEVEL/NAME ---------- --   START   LENGTH PICTURE--       
IN-FIELD1                                   01       14 A               
IN-FIELD2                                   16       14 A               
**                                                               11111 *
**                                                      12345678901234 *
**                                                      999,999,999.99 *
W1-FIELD                                    01       14 A               
W1-FIELD1                        W1-FIELD            03 A               
W1-FIELD2                        W1-FIELD  +04       03 A               
W1-FIELD3                        W1-FIELD  +08       03 A               
W1-FIELD4                        W1-FIELD  +12       02 A               
**                                                                  11 *
**                                                      123 456 789 01 *
**                                                      999 999 999 99 *
W2-FIELD                                     W       11 N 02           
W2-FIELD1                         W2-FIELD           03 A               
W2-FIELD2                         W2-FIELD +03       03 A               
W2-FIELD3                         W2-FIELD +06       03 A               
W2-FIELD4                         W2-FIELD +09       02 A       
W2-FIELDA                         W2-FIELD           01 A +     
                                             OCCURS 11 INDEX CNT
**                                                             
OUT-FIELD1                                   W       11 N 02   
OUT-FIELD2                                   W       11 N 02   
*                                                               
JOB INPUT INFILE                                               
    W1-FIELD  = IN-FIELD1                                       
    PERFORM REMOVE-COMMAS                                       
    OUT-FIELD1 = W2-FIELD                                       
                                                               
    W1-FIELD  = IN-FIELD2                                       
    PERFORM REMOVE-COMMAS                                       
    OUT-FIELD2 = W2-FIELD                                       

   ...

*                             
REMOVE-COMMAS. PROC.           
    W2-FIELD1 = W1-FIELD1     
    W2-FIELD2 = W1-FIELD2     
    W2-FIELD3 = W1-FIELD3     
    W2-FIELD4 = W1-FIELD4     
                               
    CNT = 0                   
    DO WHILE CNT LE 11         
       IF W2-FIELDA NOT NUMERIC
           W2-FIELDA = '0'     
       END-IF                 
       CNT = CNT + 1           
    END-DO                     
END-PROC.                     
*                             

I hope this helps.
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 -> CA Products

 


Similar Topics
Topic Forum Replies
No new posts Using API Gateway from CICS program CICS 0
No new posts DB2 Event passed to the Application P... DB2 1
No new posts How to pass the PARM value to my targ... COBOL Programming 8
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
No new posts EZT program to build a flat file with... All Other Mainframe Topics 9
Search our Forums:

Back to Top