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
 

 

Regarding numeric to packed decimal and outrec formatting

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
ram_vizag

New User


Joined: 21 Aug 2008
Posts: 92
Location: hyd

PostPosted: Tue Feb 11, 2014 2:32 pm    Post subject: Regarding numeric to packed decimal and outrec formatting
Reply with quote

Hi friends,

I have a record with length 323 which is coming from informatica in ASCII.
Of these few fields are to be converted from numeric to packed decimALS.
below are the fields positions which need to be converted into packed decimal and binary respectively to get executed on mainframe.

i could not format the below can some one help me on these.


Code:

OPTION COPY                                 
OUTREC FIELDS=(40,11,ZD,TO=PD,LENGTH=6,AND,
               51,11,ZD,TO=PD,LENGTH=6,AND,
               62,11,ZD,TO=PD,LENGTH=6,AND,
               73,11,ZD,TO=PD,LENGTH=6,AND,
               148,9,ZD,TO=BI,LENGTH=4,AND,
               159,2,ZD,TO=PD,LENGTH=2,AND,
               270,11,ZD,TO=PD,LENGTH=6,AND,
               281,11,ZD,TO=PD,LENGTH=6,AND,
               299,4,ZD,TO=BI,LENGTH=2,AND,
               304,9,ZD,TO=BI,LENGTH=4,AND,
               313,11,ZD,TO=PD,LENGTH=6)   
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7225

PostPosted: Tue Feb 11, 2014 2:45 pm    Post subject: Reply to: Regarding numeric to packed decimal and outrec for
Reply with quote

Don't use OUTREC FIELDS, use OUTREC BUILD.

Ditch the ANDs.
Back to top
View user's profile Send private message
ram_vizag

New User


Joined: 21 Aug 2008
Posts: 92
Location: hyd

PostPosted: Tue Feb 11, 2014 2:54 pm    Post subject: Re: Reply to: Regarding numeric to packed decimal and outrec
Reply with quote

Bill Woodger wrote:
Don't use OUTREC FIELDS, use OUTREC BUILD.

Ditch the ANDs.


Hi bill,

Thanks for ur suggestion, But when i give first line of code alone, its working but with the whole code its not working i believe there is syntax error in my code may be in formatting as well. Could you please suggust on the same
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Tue Feb 11, 2014 3:03 pm    Post subject: Reply to: Regarding numeric to packed decimal and outrec for
Reply with quote

Quote:
... but with the whole code its not working ...


do You realize that just whining it is not working is only a waste of time for everybody.

if You do not tell the error and post some significant info the chances of getting help are pretty slim.
Back to top
View user's profile Send private message
ram_vizag

New User


Joined: 21 Aug 2008
Posts: 92
Location: hyd

PostPosted: Tue Feb 11, 2014 3:11 pm    Post subject: Re: Reply to: Regarding numeric to packed decimal and outrec
Reply with quote

enrico-sorichetti wrote:
Quote:
... but with the whole code its not working ...


do You realize that just whining it is not working is only a waste of time for everybody.

if You do not tell the error and post some significant info the chances of getting help are pretty slim.


hi enrico,

below is the error code:
Code:

********************************* TOP OF DATA **********************************

2016                           
 SYSIN :                                                                       
   OPTION COPY                                                           0012000
   OUTREC BUILD =(40,11,ZD,TO=PD,LENGTH=6,AND,                           0013000
          *                                                                     
                  51,11,ZD,TO=PD,LENGTH=6,AND,                           0014000
                  *                                                             
                  62,11,ZD,TO=PD,LENGTH=6,AND,                           0015000
                  *                                                             
                  73,11,ZD,TO=PD,LENGTH=6,AND,                           0016000
                  *                                                             
                  148,9,ZD,TO=BI,LENGTH=4,AND,                           0017000
                  *                                                             
                  159,2,ZD,TO=PD,LENGTH=2,AND,                           0018000
                  *                                                             
                  270,11,ZD,TO=PD,LENGTH=6,AND,                          0019000
                  *                                                             
                  281,11,ZD,TO=PD,LENGTH=6,AND,                          0020000
                  *                                                             
                  299,4,ZD,TO=BI,LENGTH=2,AND,                           0021000
                  *                                                             
                  304,9,ZD,TO=BI,LENGTH=4,AND,                           0022000
                  *                                                             
                  313,11,ZD,TO=PD,LENGTH=6)                              0023000
                  *                                                             
 WER268A  OUTREC STATEMENT  : SYNTAX ERROR                                     
 WER275A  NO KEYWORDS FOUND ON CONTROL STATEMENT                               
 WER275A  NO KEYWORDS FOUND ON CONTROL STATEMENT                               
 WER275A  NO KEYWORDS FOUND ON CONTROL STATEMENT                               
 WER275A  NO KEYWORDS FOUND ON CONTROL STATEMENT                               
 WER275A  NO KEYWORDS FOUND ON CONTROL STATEMENT                               
 WER275A  NO KEYWORDS FOUND ON CONTROL STATEMENT                               

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

New User


Joined: 21 Aug 2008
Posts: 92
Location: hyd

PostPosted: Tue Feb 11, 2014 3:24 pm    Post subject: Regarding numeric to packed decimal and outrec formatting
Reply with quote

Hi enrico/Bill,

The below code is working for me but i need to carry out the remaining fields in the output file along with the below fields and reduce the file record length from 323 to 276.

Code:


OPTION COPY                   
OUTREC FIELDS=(40,11,ZD,TO=PD,
               51,11,ZD,TO=PD,
               62,11,ZD,TO=PD,
               73,11,ZD,TO=PD,
               148,9,ZD,TO=BI,
               159,2,ZD,TO=PD,
               270,11,ZD,TO=PD,
               281,11,ZD,TO=PD,
               299,4,ZD,TO=BI,
               304,9,ZD,TO=BI,
               313,11,ZD,TO=PD)



please suggest how to format the remainingg fields. I think the fields other than these will have a change in their positions and how i need to handle this
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7225

PostPosted: Tue Feb 11, 2014 4:09 pm    Post subject: Reply to: Regarding numeric to packed decimal and outrec for
Reply with quote

Psychic day this week.


Code:
OPTION COPY                   
OUTREC BUILD=(1,39,
              40,11,ZD,TO=PD,
               51,11,ZD,TO=PD,
               62,11,ZD,TO=PD,
               73,11,ZD,TO=PD,
               84,64,
               148,9,ZD,TO=BI,
               157,2,
               159,2,ZD,TO=PD,
               161,109,
               270,11,ZD,TO=PD,
               281,11,ZD,TO=PD,
               292,7,
               299,4,ZD,TO=BI,
               303,1,
               304,9,ZD,TO=BI,
               313,11,ZD,TO=PD)


You had the LENGTH= earlier, you'll need them back, because you'll get default lengths.

I've not been particularly careful doing this (spare 18 seconds), so you'll have to check.
Back to top
View user's profile Send private message
ram_vizag

New User


Joined: 21 Aug 2008
Posts: 92
Location: hyd

PostPosted: Tue Feb 11, 2014 8:43 pm    Post subject: Re: Reply to: Regarding numeric to packed decimal and outrec
Reply with quote

Bill Woodger wrote:
Psychic day this week.


Code:
OPTION COPY                   
OUTREC BUILD=(1,39,
              40,11,ZD,TO=PD,
               51,11,ZD,TO=PD,
               62,11,ZD,TO=PD,
               73,11,ZD,TO=PD,
               84,64,
               148,9,ZD,TO=BI,
               157,2,
               159,2,ZD,TO=PD,
               161,109,
               270,11,ZD,TO=PD,
               281,11,ZD,TO=PD,
               292,7,
               299,4,ZD,TO=BI,
               303,1,
               304,9,ZD,TO=BI,
               313,11,ZD,TO=PD)


You had the LENGTH= earlier, you'll need them back, because you'll get default lengths.

I've not been particularly careful doing this (spare 18 seconds), so you'll have to check.


Hi bill,

Thanks,

But i could not see ur code working. the field sare not being converted into packed decimal.

Code:

       #10                                 #11                  #12
       AN 32:8                         PD 40:6              PD 46:6
       <---+-->                  <---+----1-->        <---+----1-->
****** ****  Top of data  ****                                     
=LGTH  01000000                  *************        *************
=LGTH  08001000                  *************        *************
=LGTH  01000000                  *************        *************
=LGTH  01000000                  *************        *************
=LGTH  01000000                  *************        *************
=LGTH  13001000                  *************        *************



please suggest me how to proceed further.

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

New User


Joined: 21 Aug 2008
Posts: 92
Location: hyd

PostPosted: Tue Feb 11, 2014 9:22 pm    Post subject:
Reply with quote

Hi Bill,

I just investigated and found that the info which informatica send the data is in edited numeric.here is my analysis:

999999999.99--its taking as 12 bytes, i need to convert this into packed decimal

also few fields are need to be stored in comp which is binary. how to define the input layout for the same???

input fields(data from informatica)----------->outfields
--------------------------------------- ----------

1. numeric-------------------------------------->could read as edited numeric
2. numeric-------------------------------------->need to read as binary.how
---------------------------------------------------to define in mainframe cpy bk

also , please can you suggest how to convert into packed decimal.
is it better to go with a simple cobol program??
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7225

PostPosted: Tue Feb 11, 2014 9:22 pm    Post subject: Reply to: Regarding numeric to packed decimal and outrec for
Reply with quote

Show the code that does not work. Did you put LENGTH= on your converted fields?

All I did was show you how to "fill in the gaps" between your fields you want to convert. I cannot know if you have defined your positions correctly, or if you have got the correct lengths for them. I'm not that psychic.
Back to top
View user's profile Send private message
ram_vizag

New User


Joined: 21 Aug 2008
Posts: 92
Location: hyd

PostPosted: Tue Feb 11, 2014 9:45 pm    Post subject: sort code...
Reply with quote

ram_vizag wrote:
Hi Bill,

I just investigated and found that the info which informatica send the data is in edited numeric.here is my analysis:

999999999.99--its taking as 12 bytes, i need to convert this into packed decimal

also few fields are need to be stored in comp which is binary. how to define the input layout for the same???

input fields(data from informatica)----------->outfields
--------------------------------------- ----------

1. numeric-------------------------------------->could read as edited numeric
2. numeric-------------------------------------->need to read as binary.how
---------------------------------------------------to define in mainframe cpy bk

also , please can you suggest how to convert into packed decimal.
is it better to go with a simple cobol program??



hi bill,
this is th ebelow code which i have donw with ,
yet i could not get th eoutput then i found that teh data from informatica is in edited numeric format.

please suggest how to procedd on this.

Code:

OPTION COPY                             
OUTREC FIELDS=(40,11,ZD,TO=PD,LENGTH=6,
               51,11,ZD,TO=PD,LENGTH=6,
               62,11,ZD,TO=PD,LENGTH=6,
               73,11,ZD,TO=PD,LENGTH=6,
               148,9,ZD,TO=BI,LENGTH=4,
               159,2,ZD,TO=PD,LENGTH=2,
               270,11,ZD,TO=PD,LENGTH=6,
               281,11,ZD,TO=PD,LENGTH=6,
               299,4,ZD,TO=BI,LENGTH=2,
               304,9,ZD,TO=BI,,LENGTH=4,
               313,11,ZD,TO=PD,LENGTH=6)
         END                           

Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7225

PostPosted: Tue Feb 11, 2014 9:51 pm    Post subject: Reply to: Regarding numeric to packed decimal and outrec for
Reply with quote

Pick a representative part of your data, show some sample records for that and expected output.

With your example, you are only attempting to get the numeric fields on your output. Is that what you want?

Meanwhile, experiment with FS instead of ZD.
Back to top
View user's profile Send private message
ram_vizag

New User


Joined: 21 Aug 2008
Posts: 92
Location: hyd

PostPosted: Tue Feb 11, 2014 10:44 pm    Post subject: Re: Reply to: Regarding numeric to packed decimal and outrec
Reply with quote

Bill Woodger wrote:
Pick a representative part of your data, show some sample records for that and expected output.

With your example, you are only attempting to get the numeric fields on your output. Is that what you want?

Meanwhile, experiment with FS instead of ZD.


Hi bill,

Thanks for ur quick response and help...for now i dont have system..
how ever i can present the data i want

input: +721.99( is in edited numeric)
out put : should be converted into packed decimal and when using file manager the value should be look like above only. I mean +721.99

secondly,
for binary:
data should be converted to s9(4) comp and s9(8) comp.
when i declared the informatica data in numeric to check in file manager i could not see any value coming in. what could be the reason??

please suggest...
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Comparing Decimal and CHAR columns rakesh17684 DB2 7 Thu Oct 20, 2016 2:33 am
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts SORT- outrec ram_vizag DFSORT/ICETOOL 10 Tue Sep 27, 2016 12:50 am
No new posts Casting a Binary Number to Numeric in... Bob Steinkraus Java & MQSeries 6 Tue Aug 09, 2016 5:58 pm
This topic is locked: you cannot edit posts or make replies. Alphanumeric to Numeric move on UNIX mistah kurtz COBOL Programming 16 Wed Jul 27, 2016 8:47 pm


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