Author |
Message
|
wmc27 |
Posted: Tue Jun 18, 2013 5:41 am Post subject: Space function in ESQL |
|
|
 Apprentice
Joined: 18 Dec 2008 Posts: 31
|
Good Morning!!!
Is there any space function available in ESQL ?
i am trying to send fixed spaces for each field,Like
AB_ _ _ _ EFG_ _ HI_
I tried using the SPACE() but no luck so far
Thx
S |
|
Back to top |
|
 |
Vitor |
Posted: Tue Jun 18, 2013 5:58 am Post subject: Re: Space function in ESQL |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
wmc27 wrote: |
i am trying to send fixed spaces for each field,Like
AB_ _ _ _ EFG_ _ HI_
|
Why not use a message set to pad the fields out?
wmc27 wrote: |
I tried using the SPACE() but no luck so far |
What luck were you expecting? A lottery win? Are you claiming the SPACE function does not return spaces as described in the documentation? If so, it's a product defect. If not, what are you claiming as the result of this function?
Better information, better advice. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
wmc27 |
Posted: Tue Jun 18, 2013 6:11 am Post subject: Space function in ESQL |
|
|
 Apprentice
Joined: 18 Dec 2008 Posts: 31
|
Thanks Victor for the quick reply,
right now i am passing the spaces something like this
SET OutputRoot.DFDL.xxxx.xxxx.CD=SPACE(3);
SET Out putRoot.DFDL.xxxx.xxxx.DE=SPACE(4);
ETC..
How do i pad the fields in message set and propagate the blank spaces.
Thx
S |
|
Back to top |
|
 |
mqjeff |
Posted: Tue Jun 18, 2013 6:15 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
You tell the DFDL properties to do this for you.
Stare at the properties you have available for each of these fields. Keep staring at them until it become obvious that you need to adjust the length and the padding. |
|
Back to top |
|
 |
kimbert |
Posted: Tue Jun 18, 2013 6:16 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
How do i pad the fields in message set and propagate the blank spaces |
If you are using v6.1 or v7:
- create a message set
- add a TDS physical format
- create a logical model that describes the structure of your data
- add TDS properties to the groups and elements to describe your physical format
If you are using v8 ( or IIB v9 )
- create a DFDL schema for your data format
In both cases, if you have a COBOL copybook that describes your data format then you can just import it to create your message set or DFDL schema. |
|
Back to top |
|
 |
Vitor |
Posted: Tue Jun 18, 2013 6:42 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
mqjeff wrote: |
You tell the DFDL properties to do this for you. |
ESQL is the wrong place to do this, and I'm not surprised it's not working given how you've probably got DFDL set up.
(Note: my comment about message sets was based on the assumption you were at a broker level lower than WMBv8. Do not create a message set to fix this; stick with DFDL). _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
wmc27 |
Posted: Tue Jun 18, 2013 6:49 am Post subject: |
|
|
 Apprentice
Joined: 18 Dec 2008 Posts: 31
|
i am at version 8.0.0.2 and i am using DFDL,
i have imported the copy book,that created DFDL schema and i add fixed spaces for each field,remaining transformations i am doing in ESQL and passing along.
Thx
S |
|
Back to top |
|
 |
kimbert |
Posted: Tue Jun 18, 2013 10:37 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Oops. Didn't notice that the OP was using the DFDL domain
Quote: |
i have imported the copy book,that created DFDL schema |
OK - that's a good start
Quote: |
and i add fixed spaces for each field |
Not good. In fact, that's pretty bad. The whole point of DFDL is to handle the data format for you.
Quote: |
remaining transformations i am doing in ESQL and passing along. |
OK
Check that 'padKind' is set to 'padChar'. Check that the lengthKind is 'explicit'. Check that the length is correctly set. |
|
Back to top |
|
 |
wmc27 |
Posted: Tue Jun 18, 2013 11:26 am Post subject: |
|
|
 Apprentice
Joined: 18 Dec 2008 Posts: 31
|
padKind' is set to 'padChar', lengthKind is 'explicit' and
length is correctly set
all i am updating is the default value of DFDL schema. |
|
Back to top |
|
 |
kimbert |
Posted: Tue Jun 18, 2013 12:13 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
all i am updating is the default value of DFDL schema. |
Good - if these fields are missing from the input then you must assign default values to them. If they are string fields then you can assign the empty string as the default value - the padding options will take care of the rest. |
|
Back to top |
|
 |
mqceries |
Posted: Tue Jun 18, 2013 12:27 pm Post subject: |
|
|
 Acolyte
Joined: 02 Dec 2011 Posts: 70
|
I believe you are right track, i am also learning DFDL. one of my services i used DFDL properties to padd... correct me if i am wrong. i main properties will be
I still have to fix Escape Schema Reference to None. Hope this helps. |
|
Back to top |
|
 |
kimbert |
Posted: Tue Jun 18, 2013 1:10 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
@wmc27: Just to be 100% clear, the default values are part of the DFDL xsd - you do not need to write any ESQL to assign a default value to the missing fields.
@mqceries: Good to hear that you're learning DFDL.
FYI the property name is 'Escape Scheme' ( not 'Schema' ). It is only used when lengthKind is 'delimited'. It defines when a separator or terminator can be treated as part of the data. |
|
Back to top |
|
 |
mqceries |
Posted: Tue Jun 18, 2013 1:19 pm Post subject: |
|
|
 Acolyte
Joined: 02 Dec 2011 Posts: 70
|
thanks and much appreciate Kimbert. |
|
Back to top |
|
 |
|