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
 

 

How to eliminate the commas in easy trieve program

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CA Products
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    Post subject: How to eliminate the commas in easy trieve program
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    Post subject:
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    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 Writing a file using online program grvtomar PL/I & Assembler 3 Fri Jun 30, 2017 1:06 pm
No new posts pre-compiler for program in an HFS Pedro DB2 0 Fri Jun 23, 2017 11:13 pm
No new posts Compiling program in endeavor for tra... RALAKKAL Compuware & Other Tools 4 Mon Jun 05, 2017 8:27 pm
No new posts COBOL DB2 program - zIIP eligible vasanthz COBOL Programming 7 Wed May 31, 2017 5:12 am
No new posts DB2 Program abending without giving a... rahulgarg14 DB2 7 Mon May 29, 2017 8:10 pm


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