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
 
Trying to convert amounts.....

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Michaelod
Warnings : 1

New User


Joined: 02 Sep 2008
Posts: 49
Location: Edinburgh

PostPosted: Tue Oct 13, 2009 6:25 pm    Post subject: Trying to convert amounts.....
Reply with quote

I have the following input file:

Code:
+0000000000000000000000000200.10,+0000000000000000000000000200.10
-0000000000000000000000000100.20,-0000000000000000000000000100.20


We'll call the amounts amt 1 and amt 2.

I need to create an audit file with 4 amount fields as follows:

Amt 1 total debits,Amt 1 total credits,Amt 2 total debits,Amt 2 total credits

I get the following output:

Code:
-0000000000000000000000000100.20,+0000000000000000000000000200.10,-0000000000000000000000000100.20,+0000000000000000000000000200.10


using the following data:

Code:
INREC IFTHEN=(WHEN=(1,1,CH,EQ,C'-'),                           
        OVERLAY=(66:1,32),HIT=NEXT),                           
      IFTHEN=(WHEN=(1,1,CH,EQ,C'+'),                           
        OVERLAY=(98:1,32),HIT=NEXT),                           
      IFTHEN=(WHEN=(34,1,CH,EQ,C'-'),                           
        OVERLAY=(130:34,32),HIT=NEXT),                           
      IFTHEN=(WHEN=(34,1,CH,EQ,C'+'),                           
        OVERLAY=(162:34,32))                                     
OUTFIL FNAMES=OUT,REMOVECC,NODETAIL,                             
OUTREC=(1,51,80X),                                               
TRAILER1=(1:TOT=(66,32,SFF,EDIT=(STTTTTTTTTTTTTTTTTTTTTTTTTTTT.TT),
          SIGNS=(-)),                                             
          SEPERATOR,                                             
          TOT=(98,32,SFF,EDIT=(STTTTTTTTTTTTTTTTTTTTTTTTTTTT.TT),
          SIGNS=(+)),                                             
          SEPERATOR,                                             
          TOT=(130,32,SFF,EDIT=(STTTTTTTTTTTTTTTTTTTTTTTTTTTT.TT),
          SIGNS=(-)),                                             
          SEPERATOR,                                             
          TOT=(162,32,SFF,EDIT=(STTTTTTTTTTTTTTTTTTTTTTTTTTTT.TT),
          SIGNS=(+)))


However, I require the amount fields inthe audit record to have 4 decimal places rather than 2 as follows:

Code:
-00000000000000000000000100.2000,+00000000000000000000000200.1000,-00000000000000000000000100.2000,+00000000000000000000000200.1000


Each field should still be 32 bytes long.

Can anyone help?
Back to top
View user's profile Send private message

Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Tue Oct 13, 2009 8:43 pm    Post subject: Reply to: Trying to convert amounts.....
Reply with quote

Michaelod,

Try these control cards

Code:

//SYSIN    DD *                                                         
  SORT FIELDS=COPY                                                     
  INREC IFTHEN=(WHEN=INIT,                                             
  BUILD=(+100,MUL,01,32,SFF,PD,LENGTH=16,                               
         +100,MUL,34,32,SFF,PD,LENGTH=16,                               
         +0,TO=PD,LENGTH=16,+0,TO=PD,LENGTH=16)),                       
  IFTHEN=(WHEN=(01,16,PD,LT,0),                                         
  OVERLAY=(33:1,16,1:+0,TO=PD,LENGTH=16),HIT=NEXT),                     
  IFTHEN=(WHEN=(17,16,PD,LT,0),                                         
  OVERLAY=(49:17,16,17:+0,TO=PD,LENGTH=16))                             
                                                                       
  OUTFIL FNAMES=OUT,REMOVECC,NODETAIL,BUILD=(131X),                     
  TRAILER1=(1:TOT=(33,16,PD,EDIT=(STTTTTTTTTTTTTTTTTTTTTTTTTT.TTTT),   
            SIGNS=(+,-)),                                               
            SEPERATOR,                                                 
            TOT=(01,16,PD,EDIT=(STTTTTTTTTTTTTTTTTTTTTTTTTT.TTTT),     
            SIGNS=(+)),                                                 
            SEPERATOR,                                                 
            TOT=(49,16,PD,EDIT=(STTTTTTTTTTTTTTTTTTTTTTTTTT.TTTT),     
            SIGNS=(+,-)),                                               
            SEPERATOR,                                                 
            TOT=(17,16,PD,EDIT=(STTTTTTTTTTTTTTTTTTTTTTTTTT.TTTT),     
            SIGNS=(+)))                                                 
Back to top
View user's profile Send private message
Michaelod
Warnings : 1

New User


Joined: 02 Sep 2008
Posts: 49
Location: Edinburgh

PostPosted: Tue Oct 13, 2009 9:39 pm    Post subject: Reply to: Trying to convert amounts.....
Reply with quote

Should the lengths not be 32?

What would happen if any of the amount fields are 0 or spaces?
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Tue Oct 13, 2009 10:06 pm    Post subject: Re: Reply to: Trying to convert amounts.....
Reply with quote

Michaelod wrote:
Should the lengths not be 32?


yes the length is indeed 32.

Michaelod wrote:
What would happen if any of the amount fields are 0 or spaces?


why don't you run the job and see it yourself?
Back to top
View user's profile Send private message
Michaelod
Warnings : 1

New User


Joined: 02 Sep 2008
Posts: 49
Location: Edinburgh

PostPosted: Wed Oct 14, 2009 2:21 pm    Post subject:
Reply with quote

Skolusu,

Your code doesnt work........it gives me output as follows:

Code:
808080808080808080808080808.0808,808080808080808080808080808.0808,808080808080808080808080808.0808,808080808080808080808080808.0808


Why do I have to convert the amounts to PD?
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Oct 14, 2009 7:30 pm    Post subject:
Reply with quote

Hello,

Please post the informational messages (including the message ids) from this run.

PD is used by the underlying assembler instruction to edit the output value.
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Wed Oct 14, 2009 9:54 pm    Post subject:
Reply with quote

Michaelod wrote:
Skolusu,

Your code doesnt work........it gives me output as follows:

Code:
808080808080808080808080808.0808,808080808080808080808080808.0808,808080808080808080808080808.0808,808080808080808080808080808.0808


Why do I have to convert the amounts to PD?


Did you run with the same input you showed me? show me the JCL you used and also sample input atleast the first 15 records
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Convert rows and column into JSON for... Dinesh Manivannan DB2 2 Sun Sep 03, 2017 6:50 pm
No new posts Convert CLIST to REXX cvnlynn CLIST & REXX 12 Tue Jun 27, 2017 2:06 am
No new posts Convert current to hex value gopurs DFSORT/ICETOOL 4 Wed Feb 15, 2017 5:40 am
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts Convert +9999999999999.99 to S9(12)V9(3) vnktrrd DFSORT/ICETOOL 8 Thu Nov 17, 2016 8:15 pm

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