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
 

 

Conveting amounts to a different format

 
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: Mon Sep 07, 2009 7:34 pm    Post subject: Conveting amounts to a different format
Reply with quote

Hi,

I have a which can have amount fields with varied decinal places as shown below:

Code:

EPN01     ,                             +14,JG
EPN01     ,                         +123.01,JG
EPN01     ,                      -4785.0104,JG


I need the output to look like the following:

Code:

EPN01     ,+0000000000000000000000000000014,JG
EPN01     ,+0000000000000000000000000123.01,JG
EPN01     ,-00000000000000000000004785.0104,JG


Anyone have any ideas?

Thanks
Back to top
View user's profile Send private message

Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Tue Sep 08, 2009 12:27 am    Post subject:
Reply with quote

May I ask what is business need to represent so?

Will below accepted as output?
Code:

EPN01 ,+00000000000000000000000014.0000,JG
EPN01 ,+00000000000000000000000123.0100,JG
EPN01 ,-00000000000000000000004785.0104,JG
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 Sep 08, 2009 2:23 am    Post subject: Reply to: Conveting amounts to a different format
Reply with quote

Yes......that is actually the way it should be.

I require the field to be +9(26).9(4)

Thanks
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Tue Sep 08, 2009 2:59 am    Post subject: Re: Reply to: Conveting amounts to a different format
Reply with quote

Michaelod wrote:
Yes......that is actually the way it should be.

I require the field to be +9(26).9(4)

Thanks



Code:
I need the output to look like the following:

EPN01 ,+0000000000000000000000000000014,JG
EPN01 ,+0000000000000000000000000123.01,JG
EPN01 ,-00000000000000000000004785.0104,JG



Only the last of your three examples of the output meets the requirement of PIC +9(26).9(4).
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Tue Sep 08, 2009 3:22 am    Post subject:
Reply with quote

Michaelod,

Craq is correct that you're contradicting yourself. Do you want the output values to have their original number of decimal places as shown in your first post, for example:

Code:

+0000000000000000000000000000014


Or do you want the output values to have 4 decimal places, for example:

Code:

+00000000000000000000000014.0000


or:

Code:

+00000000000000000000000000.0014


or something else?

Please show a better example of input and expected output records.

Please use ubb code tags.
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 Sep 08, 2009 2:13 pm    Post subject:
Reply with quote

Output should be:

EPN01 ,+00000000000000000000000014.0000,JG
EPN01 ,+00000000000000000000000123.0100,JG
EPN01 ,-00000000000000000000004785.0104,JG
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 Sep 08, 2009 8:51 pm    Post subject:
Reply with quote

I would have the following records:

Code:
1,EPN01     ,                             +14,JG
1,EPN01     ,                         +123.01,JG
1,EPN01     ,                      -4785.0104,JG
9,EPN01     ,                      -4785.0104,                         +137.01


The first byte is the type of record i.e. 1 = data, 9 = trailer

The amount fields in the trailer record are total debits and total credits


I would expect the output to look like the following:

Code:
1,EPN01 ,+00000000000000000000000014.0000,JG
1,EPN01 ,+00000000000000000000000123.0100,JG
1,EPN01 ,-00000000000000000000004785.0104,JG
9,EPN01 ,-00000000000000000000004785.0104,+0000000000000000000000137.0100
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Tue Sep 08, 2009 11:14 pm    Post subject:
Reply with quote

Here's a DFSORT job that will do what you asked for. I assumed your input file has RECFM=FB and LRECL=80, but the job can be changed appropriately for other attributes:

Code:

//S1    EXEC  PGM=SORT
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (FB/80)
//SORTOUT DD DSN=...  output file (FB/80)
//SYSIN    DD    *
  OPTION COPY
  ALTSEQ CODE=(40F0)
  INREC IFTHEN=(WHEN=INIT,
    PARSE=(%01=(ABSPOS=19,ENDBEFR=C'.',ENDBEFR=C',',FIXLEN=32),
           %02=(ENDBEFR=C',',FIXLEN=4)),
    OVERLAY=(81:%01,SFF,
      EDIT=(STTTTTTTTTTTTTTTTTTTTTTTTTT),SIGNS=(+,-),
      C'.',%02,TRAN=ALTSEQ)),
   IFTHEN=(WHEN=(1,1,CH,EQ,C'9'),
    PARSE=(%03=(ABSPOS=47,STARTAT=NONBLANK,
      ENDBEFR=C'.',ENDBEFR=C' ',FIXLEN=32),
        %04=(FIXLEN=4)),
    OVERLAY=(113:%03,SFF,
      EDIT=(STTTTTTTTTTTTTTTTTTTTTTTTTT),SIGNS=(+,-),C'.',
      %04,TRAN=ALTSEQ))
  OUTREC IFTHEN=(WHEN=(109,4,FS,NE,NUM),OVERLAY=(109:4C'0'))
  OUTFIL IFOUTLEN=80,
     IFTHEN=(WHEN=(1,1,CH,EQ,C'1'),BUILD=(1,8,C',',81,32,46,35)),
     IFTHEN=(WHEN=(1,1,CH,EQ,C'9'),
       BUILD=(1,8,C',',81,32,113,32))
/*
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 Sep 09, 2009 2:24 pm    Post subject:
Reply with quote

Frank,

Thanks for that.

Sorry to be a pest but I have another file I have to do the same thing with only the layout is different.

The input is:

Code:
1,SGL10     ,090302,                                                  ,090302,          1111111111, ,      ,P,00,                            +100,TEST JOURNAL ENTRY DESCRIPTION                              ,GBP,830046206,123456,123456,123456,SGL10001FD,EUR,         ,        ,                            +100
1,SGL10     ,090302,                                                  ,090302,          1111111111, ,      ,P,00,                         -100.01,TEST JOURNAL ENTRY DESCRIPTION                              ,GBP,830046206,123456,123456,123456,SGL10001FD,EUR,         ,        ,                        -100.123
1,SGL10     ,090302,                                                  ,090302,          1111111111, ,      ,P,00,                       +100.1234,TEST JOURNAL ENTRY DESCRIPTION                              ,GBP,830046206,123456,123456,123456,SGL10001FD,USD,         ,        ,                          +100.2
9,SGL10     ,20090302,20090302,                         -100.01,                       +200.1234,                        -100.123,                          +200.2,000000003


In a data record i.e. type '1', there are 2 amount fields on each row. Amount 1 vegins in position 114 and amount 2 in position 277. The record length is 308.

In a trailer record i.e. type '9', there are 4 amount fields (credits and debits for each amount field in a type 1 record). They begin in positions 32, 65, 98 and 131.

I would expect the output to look like:

Code:
1,SGL10     ,090302,                                                  ,090302,          1111111111, ,      ,P,00,+00000000000000000000000100.0000,TEST JOURNAL ENTRY DESCRIPTION                              ,GBP,830046206,123456,123456,123456,SGL10001FD,EUR,         ,        ,+00000000000000000000000100.1230
1,SGL10     ,090302,                                                  ,090302,          1111111111, ,      ,P,00,-00000000000000000000000100.0100,TEST JOURNAL ENTRY DESCRIPTION                              ,GBP,830046206,123456,123456,123456,SGL10001FD,EUR,         ,        ,-00000000000000000000000100.2000
1,SGL10     ,090302,                                                  ,090302,          1111111111, ,      ,P,00,+00000000000000000000000100.1234,TEST JOURNAL ENTRY DESCRIPTION                              ,GBP,830046206,123456,123456,123456,SGL10001FD,USD,         ,        ,+00000000000000000000000100.0000
9,SGL10     ,20090302,20090302,-00000000000000000000000100.0100,+00000000000000000000000200.1234,-00000000000000000000000100.1230,+00000000000000000000000200.2000,000000003



I would be grateful for your help with this. I have ha a muck about but can't get it to function properly as this seems to be slightly more difficult than any previous sort I have done.

Thanks
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 Sep 09, 2009 8:07 pm    Post subject:
Reply with quote

At the moment I am using the following sortcard:

Code:
OPTION COPY                                                         
ALTSEQ CODE=(40F0)                                                 
INREC IFTHEN=(WHEN=INIT,                                           
  PARSE=(%01=(ABSPOS=114,ENDBEFR=C'.',ENDBEFR=C',',FIXLEN=32),     
         %02=(ENDBEFR=C',',FIXLEN=4),                               
         %03=(ABSPOS=277,ENDBEFR=C'.',ENDBEFR=C',',FIXLEN=32),     
         %04=(ENDBEFR=C',',FIXLEN=4)),                             
  OVERLAY=(309:%01,SFF,                                             
               EDIT=(STTTTTTTTTTTTTTTTTTTTTTTTTT),SIGNS=(+,-),     
               C'.',%02,TRAN=ALTSEQ,                               
           341:%03,SFF,                                             
               EDIT=(STTTTTTTTTTTTTTTTTTTTTTTTTT),SIGNS=(+,-),     
               C'.',%04,TRAN=ALTSEQ)),                             
 IFTHEN=(WHEN=(1,1,CH,EQ,C'9'),                                     
  PARSE=(%05=(ABSPOS=32,STARTAT=NONBLANK,                           
    ENDBEFR=C'.',ENDBEFR=C' ',FIXLEN=32),                           
      %06=(FIXLEN=4),                                               
      %07=(ABSPOS=65,STARTAT=NONBLANK,                             
           ENDBEFR=C'.',ENDBEFR=C' ',FIXLEN=32),                   
      %08=(FIXLEN=4),                                               
      %09=(ABSPOS=98,STARTAT=NONBLANK,                             
           ENDBEFR=C'.',ENDBEFR=C' ',FIXLEN=32),                   
      %10=(FIXLEN=4),                                               
      %11=(ABSPOS=131,STARTAT=NONBLANK,                             
           ENDBEFR=C'.',ENDBEFR=C' ',FIXLEN=32),                   
      %12=(FIXLEN=4)),                                             
  OVERLAY=(373:%05,SFF,                                             
               EDIT=(STTTTTTTTTTTTTTTTTTTTTTTTTT),SIGNS=(+,-),C'.',
                     %06,TRAN=ALTSEQ,                               
           405:%07,SFF,                                             
                EDIT=(STTTTTTTTTTTTTTTTTTTTTTTTTT),SIGNS=(+,-),C'.',
                %08,TRAN=ALTSEQ,                                   
           437:%09,SFF,                                             
               EDIT=(STTTTTTTTTTTTTTTTTTTTTTTTTT),SIGNS=(+,-),C'.',
                     %10,TRAN=ALTSEQ,                               
            469:%11,SFF,                                               
                 EDIT=(STTTTTTTTTTTTTTTTTTTTTTTTTT),SIGNS=(+,-),C'.', 
                 %12,TRAN=ALTSEQ))                                     
 OUTREC IFTHEN=(WHEN=(327,4,FS,NE,NUM),OVERLAY=(327:4C'0'))           
 OUTFIL IFOUTLEN=308,                                                 
    IFTHEN=(WHEN=(1,1,CH,EQ,C'1'),BUILD=(1,113,309,32,146,141,341,32)),
    IFTHEN=(WHEN=(1,1,CH,EQ,C'9'),                                     
    BUILD=(1,31,373,32,C',',405,32,C',',437,32,C',',469,32))           


However the output I get is not quite right....I get:

Code:
1,SGL10     ,090302,                                                  ,090302,          1111111111, ,      ,P,00,+00000000000000000000000100.TEST,TEST JOURNAL ENTRY DESCRIPTION                              ,GBP,830046206,123456,123456,123456,SGL10001FD,EUR,         ,        ,          +000000000000000000000
1,SGL10     ,090302,                                                  ,090302,          1111111111, ,      ,P,00,-00000000000000000000000100.TEST,TEST JOURNAL ENTRY DESCRIPTION                              ,GBP,830046206,123456,123456,123456,SGL10001FD,EUR,         ,        ,          -000000000000000000000
1,SGL10     ,090302,                                                  ,090302,          1111111111, ,      ,P,00,+00000000000000000000000100.TEST,TEST JOURNAL ENTRY DESCRIPTION                              ,GBP,830046206,123456,123456,123456,SGL10001FD,EUR,         ,        ,          +000000000000000000000
9,SGL10     ,20090302,20090302,-00000000000000000000000100.0000,+00000000000000000000000200.0000,-00000000000000000000000100.0000,+00000000000000200000000003.0000


I should get:

Code:
1,SGL10     ,090302,                                                  ,090302,          1111111111, ,      ,P,00,+00000000000000000000000100.0000,TEST JOURNAL ENTRY DESCRIPTION                              ,GBP,830046206,123456,123456,123456,SGL10001FD,EUR,         ,        ,          +000000000000000000000
1,SGL10     ,090302,                                                  ,090302,          1111111111, ,      ,P,00,-00000000000000000000000100.0000,TEST JOURNAL ENTRY DESCRIPTION                              ,GBP,830046206,123456,123456,123456,SGL10001FD,EUR,         ,        ,          -000000000000000000000
1,SGL10     ,090302,                                                  ,090302,          1111111111, ,      ,P,00,+00000000000000000000000100.0000,TEST JOURNAL ENTRY DESCRIPTION                              ,GBP,830046206,123456,123456,123456,SGL10001FD,EUR,         ,        ,          +000000000000000000000
9,SGL10     ,20090302,20090302,-00000000000000000000000100.0000,+00000000000000000000000200.0000,-00000000000000000000000100.0000,+00000000000000000000000200.0000
[/code]
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Wed Sep 09, 2009 10:51 pm    Post subject:
Reply with quote

I believe these DFSORT control statements will give you what you want (they gave me your expected output from your input):

Code:

  OPTION COPY
  ALTSEQ CODE=(40F0)
  INREC IFTHEN=(WHEN=INIT,
  PARSE=(%01=(ABSPOS=114,ENDBEFR=C'.',ENDBEFR=C',',FIXLEN=32),
         %02=(ENDBEFR=C',',FIXLEN=4),
         %03=(ABSPOS=277,ENDBEFR=C'.',FIXLEN=32),
         %04=(FIXLEN=4)),
  OVERLAY=(309:%01,SFF,
               EDIT=(STTTTTTTTTTTTTTTTTTTTTTTTTT),SIGNS=(+,-),
               C'.',%02,TRAN=ALTSEQ,
           341:%03,SFF,
               EDIT=(STTTTTTTTTTTTTTTTTTTTTTTTTT),SIGNS=(+,-),
               C'.',%04,TRAN=ALTSEQ)),
 IFTHEN=(WHEN=(1,1,CH,EQ,C'9'),
  PARSE=(%05=(ABSPOS=32,STARTAT=NONBLANK,
    ENDBEFR=C'.',ENDBEFR=C',',FIXLEN=32),
      %06=(ENDBEFR=C',',FIXLEN=4),
      %07=(ABSPOS=65,STARTAT=NONBLANK,
           ENDBEFR=C'.',ENDBEFR=C',',FIXLEN=32),
      %08=(ENDBEFR=C',',FIXLEN=4),
      %09=(ABSPOS=98,STARTAT=NONBLANK,
           ENDBEFR=C'.',ENDBEFR=C',',FIXLEN=32),
      %10=(ENDBEFR=C',',FIXLEN=4),
      %11=(ABSPOS=131,STARTAT=NONBLANK,
           ENDBEFR=C'.',FIXLEN=32),
      %12=(ENDBEFR=C',',FIXLEN=4)),
  OVERLAY=(373:%05,SFF,
               EDIT=(STTTTTTTTTTTTTTTTTTTTTTTTTT),SIGNS=(+,-),C'.',
                     %06,TRAN=ALTSEQ,
           405:%07,SFF,
                EDIT=(STTTTTTTTTTTTTTTTTTTTTTTTTT),SIGNS=(+,-),C'.',
                %08,TRAN=ALTSEQ,
           437:%09,SFF,
               EDIT=(STTTTTTTTTTTTTTTTTTTTTTTTTT),SIGNS=(+,-),C'.',
                     %10,TRAN=ALTSEQ,
            469:%11,SFF,
                 EDIT=(STTTTTTTTTTTTTTTTTTTTTTTTTT),SIGNS=(+,-),C'.',
                 %12,TRAN=ALTSEQ))
 OUTREC IFTHEN=(WHEN=(337,4,FS,NE,NUM),OVERLAY=(337:4C'0'))
 OUTFIL IFOUTLEN=308,
    IFTHEN=(WHEN=(1,1,CH,EQ,C'1'),OVERLAY=(114:309,32,277:341,32)),
    IFTHEN=(WHEN=(1,1,CH,EQ,C'9'),
    OVERLAY=(32:373,32,65:405,32,98:437,32,131:469,32))
Back to top
View user's profile Send private message
Michaelod
Warnings : 1

New User


Joined: 02 Sep 2008
Posts: 49
Location: Edinburgh

PostPosted: Thu Sep 10, 2009 2:01 pm    Post subject:
Reply with quote

Excellent - Thanks Frank - Genius!
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Thu Sep 10, 2009 9:06 pm    Post subject:
Reply with quote

Wow, I'm glad that worked. It was really tricky.

Setting up the data with unnormalized numbers like that is NOT a good idea.
Back to top
View user's profile Send private message
Michaelod
Warnings : 1

New User


Joined: 02 Sep 2008
Posts: 49
Location: Edinburgh

PostPosted: Fri Sep 11, 2009 9:02 pm    Post subject:
Reply with quote

Frank,

Unfortunately i have no say in how the data is set up icon_sad.gif

One more problem.......

There is a 9 byte record count field at the end of the type '9' data record.

I need to pad this out with leading zeroes.

When i try to do this the zeroes are at the end i.e. 331808000 instead of 000331080. The field starts in position 164.

The sort i was using was:

Code:
OPTION COPY                                                           
ALTSEQ CODE=(40F0)                                                     
INREC IFTHEN=(WHEN=INIT,                                               
  PARSE=(%01=(ABSPOS=114,ENDBEFR=C'.',ENDBEFR=C',',FIXLEN=32),         
         %02=(ENDBEFR=C',',FIXLEN=4),                                 
         %03=(ABSPOS=277,ENDBEFR=C'.',FIXLEN=32),                     
         %04=(FIXLEN=4)),                                             
  OVERLAY=(309:%01,SFF,                                               
               EDIT=(STTTTTTTTTTTTTTTTTTTTTTTTTT),SIGNS=(+,-),         
               C'.',%02,TRAN=ALTSEQ,                                   
           341:%03,SFF,                                               
               EDIT=(STTTTTTTTTTTTTTTTTTTTTTTTTT),SIGNS=(+,-),         
               C'.',%04,TRAN=ALTSEQ)),                                 
 IFTHEN=(WHEN=(1,1,CH,EQ,C'9'),                                       
  PARSE=(%05=(ABSPOS=32,STARTAT=NONBLANK,                             
              ENDBEFR=C'.',ENDBEFR=C',',FIXLEN=32),                   
         %06=(ENDBEFR=C',',FIXLEN=4),                                 
         %07=(ABSPOS=65,STARTAT=NONBLANK,                             
              ENDBEFR=C'.',ENDBEFR=C',',FIXLEN=32),                   
         %08=(ENDBEFR=C',',FIXLEN=4),                                 
         %09=(ABSPOS=98,STARTAT=NONBLANK,                             
              ENDBEFR=C'.',ENDBEFR=C',',FIXLEN=32),                   
         %10=(ENDBEFR=C',',FIXLEN=4),                                 
         %11=(ABSPOS=131,STARTAT=NONBLANK,                             
              ENDBEFR=C'.',ENDBEFR=C',',FIXLEN=32),                   
         %12=(ENDBEFR=C',',FIXLEN=4),                                 
         %13=(ABSPOS=164,STARTAT=NONBLANK,                             
              ENDBEFR=C' ',ENDBEFR=C',',FIXLEN=09)),                   
  OVERLAY=(373:%05,SFF,                                               
               EDIT=(STTTTTTTTTTTTTTTTTTTTTTTTTT),SIGNS=(+,-),C'.',   
                     %06,TRAN=ALTSEQ,                                 
           405:%07,SFF,                                               
                EDIT=(STTTTTTTTTTTTTTTTTTTTTTTTTT),SIGNS=(+,-),C'.',   
                %08,TRAN=ALTSEQ,                                       
           437:%09,SFF,                                               
               EDIT=(STTTTTTTTTTTTTTTTTTTTTTTTTT),SIGNS=(+,-),C'.',   
                      %10,TRAN=ALTSEQ,                               
            469:%11,SFF,                                             
                 EDIT=(STTTTTTTTTTTTTTTTTTTTTTTTTT),SIGNS=(+,-),C'.',
                 %12,TRAN=ALTSEQ,                                   
            501:%13,TRAN=ALTSEQ,JFY=(SHIFT=RIGHT))                   
 OUTREC IFTHEN=(WHEN=(337,4,FS,NE,NUM),OVERLAY=(337:4C'0'))         
 OUTFIL IFOUTLEN=308,                                               
    IFTHEN=(WHEN=(1,1,CH,EQ,C'1'),OVERLAY=(114:309,32,277:341,32)), 
    IFTHEN=(WHEN=(1,1,CH,EQ,C'9'),                                   
    OVERLAY=(32:373,32,65:405,32,98:437,32,131:469,32,164:501,9))   

Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Fri Sep 11, 2009 9:46 pm    Post subject:
Reply with quote

Quote:
There is a 9 byte record count field at the end of the type '9' data record.


What exactly does this 9 byte record count look like?

In one of your posts, you showed a record count at the end of the 9 record that looked like this:

000000003

If that's what it looks like, then you don't have to convert it at all. That is, you don't need %13 or 501:%13 or 164:501,9. Since we're doing overlays, just don't change this count value and it will stay the same.

If the count field doesn't look like that, show me exactly what it does look like.
Back to top
View user's profile Send private message
Michaelod
Warnings : 1

New User


Joined: 02 Sep 2008
Posts: 49
Location: Edinburgh

PostPosted: Fri Sep 11, 2009 10:32 pm    Post subject:
Reply with quote

Frank,

I thought it was already padded out but it looks like this:

Code:
+200.2,        3


rather than:

Code:
+00000000000000000000000200.2000,000000003


It starts in pos 164

Thanks[/code]
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Fri Sep 11, 2009 10:42 pm    Post subject:
Reply with quote

Ok, then I believe this will work although I didn't test it.

Code:

  OPTION COPY
  ALTSEQ CODE=(40F0)
  INREC IFTHEN=(WHEN=INIT,
   PARSE=(%01=(ABSPOS=114,ENDBEFR=C'.',ENDBEFR=C',',FIXLEN=32),
         %02=(ENDBEFR=C',',FIXLEN=4),
         %03=(ABSPOS=277,ENDBEFR=C'.',FIXLEN=32),
         %04=(FIXLEN=4)),
   OVERLAY=(309:%01,SFF,
               EDIT=(STTTTTTTTTTTTTTTTTTTTTTTTTT),SIGNS=(+,-),
               C'.',%02,TRAN=ALTSEQ,
           341:%03,SFF,
               EDIT=(STTTTTTTTTTTTTTTTTTTTTTTTTT),SIGNS=(+,-),
               C'.',%04,TRAN=ALTSEQ)),
  IFTHEN=(WHEN=(1,1,CH,EQ,C'9'),
   PARSE=(%05=(ABSPOS=32,STARTAT=NONBLANK,
              ENDBEFR=C'.',ENDBEFR=C',',FIXLEN=32),
         %06=(ENDBEFR=C',',FIXLEN=4),
         %07=(ABSPOS=65,STARTAT=NONBLANK,
              ENDBEFR=C'.',ENDBEFR=C',',FIXLEN=32),
         %08=(ENDBEFR=C',',FIXLEN=4),
         %09=(ABSPOS=98,STARTAT=NONBLANK,
              ENDBEFR=C'.',ENDBEFR=C',',FIXLEN=32),
         %10=(ENDBEFR=C',',FIXLEN=4),
         %11=(ABSPOS=131,STARTAT=NONBLANK,
              ENDBEFR=C'.',ENDBEFR=C',',FIXLEN=32),
         %12=(ENDBEFR=C',',FIXLEN=4))
   OVERLAY=(373:%05,SFF,
               EDIT=(STTTTTTTTTTTTTTTTTTTTTTTTTT),SIGNS=(+,-),C'.',
                     %06,TRAN=ALTSEQ,
           405:%07,SFF,
                EDIT=(STTTTTTTTTTTTTTTTTTTTTTTTTT),SIGNS=(+,-),C'.',
                %08,TRAN=ALTSEQ,
           437:%09,SFF,
               EDIT=(STTTTTTTTTTTTTTTTTTTTTTTTTT),SIGNS=(+,-),C'.',
                      %10,TRAN=ALTSEQ,
            469:%11,SFF,
                 EDIT=(STTTTTTTTTTTTTTTTTTTTTTTTTT),SIGNS=(+,-),C'.',
                 %12,TRAN=ALTSEQ)
 OUTREC IFTHEN=(WHEN=(337,4,FS,NE,NUM),OVERLAY=(337:4C'0'))
 OUTFIL IFOUTLEN=308,
    IFTHEN=(WHEN=(1,1,CH,EQ,C'1'),OVERLAY=(114:309,32,277:341,32)),
    IFTHEN=(WHEN=(1,1,CH,EQ,C'9'),
    OVERLAY=(32:373,32,65:405,32,98:437,32,131:469,32,
      164:164,9,UFF,TO=ZD,LENGTH=9))
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 Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm
No new posts Low values Results from VARCHAR FORMAT balaji81_k DB2 10 Thu Oct 20, 2016 1:18 am
No new posts output data in CSV Format janmejay COBOL Programming 8 Sat Oct 15, 2016 2:20 pm
This topic is locked: you cannot edit posts or make replies. output data in CSV Format janmejay DFSORT/ICETOOL 3 Sat Oct 15, 2016 2:16 pm
No new posts Format to pipe delimited with variabl... pshongal SYNCSORT 6 Wed Sep 14, 2016 2:48 pm


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