View previous topic :: View next topic
|
Author |
Message |
mushreyas
New User
Joined: 18 Jul 2008 Posts: 59 Location: Bangalore
|
|
|
|
Hi,
My input file is having data in Character format (X(19)) which i need to convert into fixed point signed (S9(18)COMP) . Can it be achieved with the below sort card.
Code: |
SORT FIELDS=COPY
INREC OVERLAY=(1,19,C,TO=FI,LENGTH=8) |
|
|
Back to top |
|
|
prasanth_thavva
New User
Joined: 28 Jul 2005 Posts: 86 Location: Chennai
|
|
|
|
yes it can be , have you tried with the control card |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
not if the data is non-numeric. Do you mean it is Zoned Decimal? |
|
Back to top |
|
|
mushreyas
New User
Joined: 18 Jul 2008 Posts: 59 Location: Bangalore
|
|
|
|
Thanks Prashant... Nic the data is numeric... Just making myself familiar with OVERLAY function. Can this function be used along with OUTREC? |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
Quote: |
Can this function be used along with OUTREC? |
Never having used SYNCSORT I have no idea but I presume you have access to the manual and that will show the syntax allowed. |
|
Back to top |
|
|
kratos86
Active User
Joined: 17 Mar 2008 Posts: 148 Location: Anna NGR
|
|
|
|
Instead we run your card and provide response. It would be faster if you run the job and see yourself what is the response. |
|
Back to top |
|
|
mushreyas
New User
Joined: 18 Jul 2008 Posts: 59 Location: Bangalore
|
|
|
|
I ran the job but it gave me syntax error. Can anyone help me with this... As is stated earlier i need to convert Character data to Binary. However i was able to convert from Binary to Character with below sort card.
Code: |
SORT FIELDS=COPY
INREC OVERLAY=(1,8,BI,TO=CH,LENGTH=19) |
|
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
The best way for you to get help is to actually post something we can use. This:
Quote: |
I ran the job but it gave me syntax error. |
is the second worst way to ask a question or present a problem. The worst is to post "It didn't work".
Post the jcl and control statements and all of the informational/diagnostic messages - including all message ids. Use the Code tag to improve readability and preserve alignment. |
|
Back to top |
|
|
mushreyas
New User
Joined: 18 Jul 2008 Posts: 59 Location: Bangalore
|
|
|
|
Apologies for not providing the complete data earlier. I can't access mainframe from home and can't access internet from Work hence the delay and inaccuracy in providing the data.Below is the JCL which i used. Input & output file is of variable length. The first 19 bytes which are in character format should be converted to Binary format.
Code: |
//STEP0001 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DISP=SHR,DSN=INPUT.FILE
//SORTOUT DD DISP=OUTPUT.FILE, DISP=SHR
//SYSIN DD *
SORT FIELDS=COPY
OUTREC FIELDS=(1,4,5,19,CH,EDIT(TTTTTTTT),LENGTH=8)
/*
|
Job failed with syntax error in the sort card pointing to CH in the OUTREC statement.
But when i tried converting from binary to character it worked. JCL is same with below sort card.
Code: |
SORT FIELDS=COPY
OUTREC FIELDS=(1,4,5,19,BI,EDIT(TTTTTTTTTTTTTTTTTTT),LENGTH=19)
|
Hope this information helps. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
I can't access mainframe from home and can't access internet from Work hence the delay |
When you want to post "mainframe things" suggest you copy them from the mainframe screen and paste them into a e-mail that you send to your home e-mail. When you get home paste the info into your post here.
Quote: |
Use the Code tag to improve readability and preserve alignment. |
Was this not clear?
Suggest you research the field limit. Is there some reason you did not post the informational/diagnostic messages - including all message ids. |
|
Back to top |
|
|
mushreyas
New User
Joined: 18 Jul 2008 Posts: 59 Location: Bangalore
|
|
|
|
Hi,
Am not supposed to send mail to outside domain.
Diagnostic message.
SORT FIELDS=COPY
OUTREC FIELDS=(1,4,5,19,CH,EDIT(TTTTTTTT),LENGTH=8)
*
WER268A INREC STATEMENT : SYNTAX ERROR .
If there is any other to convert from Character to Binary format please inform. |
|
Back to top |
|
|
mushreyas
New User
Joined: 18 Jul 2008 Posts: 59 Location: Bangalore
|
|
|
|
Thanks for your inputs. I was successfully able to perform my requirement.
I had to use the below SORT card.
SORT FIELDS=COPY
OUTREC FIELDS=(1,4,5,19,ZD,TO=BI,LENGTH=8)
As the character data contains only numeric digits i used ZD instead of CH.
Once thanks for your inputs.. I am actually new to this SYNCSORT hence its taking me sometime to learn... |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Good to hear it is working - i got sidetracked. Thank you for letting us know
If you don't already have them, i sugggest you download the documentation for your release of Syncsort so you will have it locally. Syncsort support will help you to this (if your organization is licensed). |
|
Back to top |
|
|
|