|
View previous topic :: View next topic
|
| Author |
Message |
ram_vizag
Active User
Joined: 21 Aug 2008 Posts: 112 Location: hyd
|
|
|
|
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 |
|
 |
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Don't use OUTREC FIELDS, use OUTREC BUILD.
Ditch the ANDs. |
|
| Back to top |
|
 |
ram_vizag
Active User
Joined: 21 Aug 2008 Posts: 112 Location: hyd
|
|
|
|
| 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 |
|
 |
enrico-sorichetti
Superior Member

Joined: 14 Mar 2007 Posts: 10900 Location: italy
|
|
|
|
| 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 |
|
 |
ram_vizag
Active User
Joined: 21 Aug 2008 Posts: 112 Location: hyd
|
|
|
|
| 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 |
|
 |
ram_vizag
Active User
Joined: 21 Aug 2008 Posts: 112 Location: hyd
|
|
|
|
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 |
|
 |
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
 |
ram_vizag
Active User
Joined: 21 Aug 2008 Posts: 112 Location: hyd
|
|
|
|
| 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 |
|
 |
ram_vizag
Active User
Joined: 21 Aug 2008 Posts: 112 Location: hyd
|
|
|
|
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 |
|
 |
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
 |
ram_vizag
Active User
Joined: 21 Aug 2008 Posts: 112 Location: hyd
|
|
|
|
| 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 |
|
 |
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
 |
ram_vizag
Active User
Joined: 21 Aug 2008 Posts: 112 Location: hyd
|
|
|
|
| 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 |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|