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

Regarding numeric to packed decimal and outrec formatting


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ram_vizag

Active User


Joined: 21 Aug 2008
Posts: 112
Location: hyd

PostPosted: Tue Feb 11, 2014 2:32 pm
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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue Feb 11, 2014 2:45 pm
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

Active User


Joined: 21 Aug 2008
Posts: 112
Location: hyd

PostPosted: Tue Feb 11, 2014 2:54 pm
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue Feb 11, 2014 3:03 pm
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

Active User


Joined: 21 Aug 2008
Posts: 112
Location: hyd

PostPosted: Tue Feb 11, 2014 3:11 pm
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

Active User


Joined: 21 Aug 2008
Posts: 112
Location: hyd

PostPosted: Tue Feb 11, 2014 3:24 pm
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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue Feb 11, 2014 4:09 pm
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

Active User


Joined: 21 Aug 2008
Posts: 112
Location: hyd

PostPosted: Tue Feb 11, 2014 8:43 pm
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

Active User


Joined: 21 Aug 2008
Posts: 112
Location: hyd

PostPosted: Tue Feb 11, 2014 9:22 pm
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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue Feb 11, 2014 9:22 pm
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

Active User


Joined: 21 Aug 2008
Posts: 112
Location: hyd

PostPosted: Tue Feb 11, 2014 9:45 pm
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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue Feb 11, 2014 9:51 pm
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

Active User


Joined: 21 Aug 2008
Posts: 112
Location: hyd

PostPosted: Tue Feb 11, 2014 10:44 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Issues Converting From ZD to Signed N... DFSORT/ICETOOL 4
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
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 Need help on formatting a report DFSORT/ICETOOL 14
Search our Forums:

Back to Top