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

convert to packed decimal based on condition


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
pema_yozer

New User


Joined: 16 Feb 2009
Posts: 54
Location: pune

PostPosted: Tue Aug 10, 2010 8:23 pm
Reply with quote

sqlcode1,
i have done the same thing and etting output as

[/code]
060109600104992010010703505 - 0000000000000

but for rec 6 i woul dwant output as

060109600104992010010703505 - 0000000000000
Code:
Back to top
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 577
Location: USA

PostPosted: Tue Aug 10, 2010 8:29 pm
Reply with quote

pema_yozer,

I don't see any difference in the 2 output you have posted.

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

New User


Joined: 16 Feb 2009
Posts: 54
Location: pune

PostPosted: Tue Aug 10, 2010 8:34 pm
Reply with quote

the spaces are getting filled when i submit the post
060109600104992010010703505packeddecimalspaces0000000000000
060109600104992010010703505packeddecimal0000000000000
packed decimal = 8 byte packed decimal and the
spaces = 8 spaces
but i would require it as the second one


hope this makes sense
Back to top
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 577
Location: USA

PostPosted: Tue Aug 10, 2010 9:02 pm
Reply with quote

I hate to keep this post going but are you still using FB? You had mentioned your question relating to VB was out of curiosity.

Please tell us if you are using VB or FB file. Reason I am asking is you are overlaying some of the fields (following your conversion) for record type 06 or may be I am missing some basic information.


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

New User


Joined: 16 Feb 2009
Posts: 54
Location: pune

PostPosted: Tue Aug 10, 2010 9:26 pm
Reply with quote

i'm using FB.
and want the PD to be 8 bytes
i had used over lay to get the format
060109600104992010010703505packeddecimalspaces0000000000000
but this is incorrect due to the space and would require
060109600104992010010703505packeddecimal0000000000000

i think build should be used for this.
Back to top
View user's profile Send private message
smijoss

Active User


Joined: 30 Aug 2007
Posts: 114
Location: pune

PostPosted: Wed Aug 11, 2010 10:52 am
Reply with quote

u keep confusing between VB and FB

Code:
//SORT01   EXEC PGM=SORT                                             
//SORTIN   DD  DISP=SHR,DSN=YOURID..FB.LRECL54                       
//SORTOUT  DD  DSN=YOURID.FB.LRECL54.CNVT,                           
//             DISP=(,CATLG,DELETE),                                 
//             UNIT=SYSDA                                             
//SYSIN DD *                                                         
 INREC IFTHEN=(WHEN=(01,02,CH,EQ,C'03'),                             
        OVERLAY=(23:23,16,UFF,TO=PD,LENGTH=08,8X)),                   
        IFTHEN=(WHEN=(01,02,CH,EQ,C'05'),                             
        OVERLAY=(32:32,07,UFF,TO=PD,LENGTH=03,4X)),                   
        IFTHEN=(WHEN=(01,02,CH,EQ,C'06'),                             
        OVERLAY=(28:28,16,UFF,TO=PD,LENGTH=08,44,14,8X)),                   
        IFTHEN=(WHEN=(01,02,CH,EQ,C'07'),                             
        OVERLAY=(33:33,16,UFF,TO=PD,LENGTH=08,8X))                   
  SORT FIELDS=COPY                                                   
/*                                                                   
//SYSOUT DD SYSOUT=*                                                 
//*   
Back to top
View user's profile Send private message
pema_yozer

New User


Joined: 16 Feb 2009
Posts: 54
Location: pune

PostPosted: Wed Aug 11, 2010 12:04 pm
Reply with quote

thanks..
works perfectly
Back to top
View user's profile Send private message
pema_yozer

New User


Joined: 16 Feb 2009
Posts: 54
Location: pune

PostPosted: Wed Aug 11, 2010 12:20 pm
Reply with quote

smijoss
could you plese let me know
what 44 and 14 signify
Back to top
View user's profile Send private message
pema_yozer

New User


Joined: 16 Feb 2009
Posts: 54
Location: pune

PostPosted: Wed Aug 11, 2010 12:33 pm
Reply with quote

pema_yozer wrote:
smijoss
could you plese let me know
what 44 and 14 signify



ok it figured out.. thanks again guys
Back to top
View user's profile Send private message
smijoss

Active User


Joined: 30 Aug 2007
Posts: 114
Location: pune

PostPosted: Wed Aug 11, 2010 12:38 pm
Reply with quote

OVERLAY=(28:28,16,UFF,TO=PD,LENGTH=08,44,14,8X))

while copying, it will copy the characters from 1,28
then compress you number from posion 28 to PD and fit it in 8 bytes

in the input, your next data starts from 44 with length 14

and 8x to fill spaces at the end


you could have saved a lot of efforts if you had mentioned things clearly.
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 -> DFSORT/ICETOOL Goto page 1, 2  Next

 


Similar Topics
Topic Forum Replies
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Need to convert date format DFSORT/ICETOOL 20
No new posts PD not working for unsigned packed JO... DFSORT/ICETOOL 5
No new posts Def PD not working for unsigned packe... JCL & VSAM 3
No new posts Keep leading zero(s) after convert fl... SYNCSORT 7
Search our Forums:

Back to Top