View previous topic :: View next topic
|
Author |
Message |
Michaelod Warnings : 1 New User
Joined: 02 Sep 2008 Posts: 49 Location: Edinburgh
|
|
|
|
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 |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
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 |
|
|
Michaelod Warnings : 1 New User
Joined: 02 Sep 2008 Posts: 49 Location: Edinburgh
|
|
|
|
Should the lengths not be 32?
What would happen if any of the amount fields are 0 or spaces? |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
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 |
|
|
Michaelod Warnings : 1 New User
Joined: 02 Sep 2008 Posts: 49 Location: Edinburgh
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
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 |
|
|
|
|