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

Copy a COMP data to numeric using SYNCSORT


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

New User


Joined: 27 Feb 2008
Posts: 25
Location: Phoenix, AZ,USA

PostPosted: Mon Jul 28, 2008 4:21 pm
Reply with quote

Hi Guys,
I am having a VB input file with the following data HEX data:

Code:
 
0046
0F2E


I wanted to convert the above HEX coded data into the corseponding DEC coded data and copy into an output file.

I used the folowing sort card:

Code:

  SORT FIELDS=COPY         
  OUTREC FIELDS=(5:5,9,HEX)


Taking the assumption that since the input file is a VB so started to read the data from 5th position and 9 characters are to be copied and pasted to output file satrting from 5th position.
But its giving the following error:

Code:

SORTIN   : RECFM=VBS  ; LRECL= 32004; BLKSIZE= 27998 
OUTREC   RDW NOT INCLUDED                             
SYNCSMF  CALLED BY SYNCSORT; RC=0000                 
SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE                 


please let me know , if I am going wrong somewhere

Srikanth
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1205
Location: Dublin, Ireland

PostPosted: Mon Jul 28, 2008 4:50 pm
Reply with quote

The second line of the message tells you what's wrong (OUTREC RDW NOT INCLUDED). You have to include the first 4 bytes because the file is VB (VBS).

Garry.
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Mon Jul 28, 2008 4:52 pm
Reply with quote

srikanth,

From your output

Quote:
OUTREC RDW NOT INCLUDED


RDW is not included in OUTREC FIELDS=(5:5,9,HEX) statement. you will have to include the first 4 bytes(1,4,5: .....) for RDW.

Modify the SORT card and run the job again. Also i doubt if we can use HEX in the sort card.

Post if there are still errors and i hope there would be few.
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Mon Jul 28, 2008 5:09 pm
Reply with quote

srikanth_cts wrote:
Code:

SORTIN   : RECFM=VBS  ; LRECL= 32004; BLKSIZE= 27998 
OUTREC   RDW NOT INCLUDED                             
SYNCSMF  CALLED BY SYNCSORT; RC=0000                 
SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE                 
Srikanth


Did you happen to notice that you are using SYNCSORT not DFSORT?
Back to top
View user's profile Send private message
srikanth_cts

New User


Joined: 27 Feb 2008
Posts: 25
Location: Phoenix, AZ,USA

PostPosted: Mon Jul 28, 2008 5:38 pm
Reply with quote

Thanks Aaru,
The solution you have provided has worked.I have removed the HEX in the sort card and it has extracted the data that is required.

icon_smile.gif

I will be trying with the remaining part of converting it into DEC format.


You guessed it right that by using the HEX in the following sort card is not producing the desired output:

OUTREC FIELDS=(1,4,5:5,4,HEX) ; but its giving some interesting output:


for I/P:

Code:

0046
0F2E



the O/P is:
Code:

000F426E


Which can be useful at somepoint of time ;)

Thanks again , Aaru
Back to top
View user's profile Send private message
srikanth_cts

New User


Joined: 27 Feb 2008
Posts: 25
Location: Phoenix, AZ,USA

PostPosted: Mon Jul 28, 2008 5:41 pm
Reply with quote

Craq,
Its my mistake that I have posted it in DFSORT forum.
But, I have a reason. I was not able to find the SYNCSORT Forum. So I thought that DFSORT is relatively an appropriate forum than JCL forum to request for the help!

Going forward, I will not repeat the mistake.



Thanks,
Srikanth
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Mon Jul 28, 2008 5:53 pm
Reply with quote

Look at the Forum Description:

"Clear your doubts from JCL, SYNCSORT, IDCAMS, IEBGENER, JES2 & JES3".
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Tue Jul 29, 2008 12:27 am
Reply with quote

Hello,

Try OUTREC FIELDS=(1,4,5:5,4,BI,ZD)
Back to top
View user's profile Send private message
srikanth_cts

New User


Joined: 27 Feb 2008
Posts: 25
Location: Phoenix, AZ,USA

PostPosted: Tue Jul 29, 2008 3:36 pm
Reply with quote

Thanks Dick and Aaru. I have reached to the solution !
icon_biggrin.gif
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Tue Jul 29, 2008 3:39 pm
Reply with quote

Srikanth,

Quote:
Thanks Dick and Aaru. I have reached to the solution !


Good to hear. You are welcome icon_biggrin.gif
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Tue Jul 29, 2008 7:05 pm
Reply with quote

Quote:
Thanks Dick and Aaru. I have reached to the solution !
You're welcome icon_smile.gif

It may help someone else if you post your solution.

d
Back to top
View user's profile Send private message
srikanth_cts

New User


Joined: 27 Feb 2008
Posts: 25
Location: Phoenix, AZ,USA

PostPosted: Tue Jul 29, 2008 9:36 pm
Reply with quote

Ooops, Sorry guys, I forgot to post it. Here it goes:


When I gave the following sort card>

Code:

  SORT FIELDS=COPY               
  OUTREC FIELDS=(1,4,5:5,4,BI)
/*                               


It has produced the desired output , i.e converted the HEX values into DEC values and extracted the 9 digits (except that in the 9 digits , if the starting digit(S) is/are zero/Zeros they are not seen in the output:

here I denonstrate:

i/p

Code:

0046
0F2E


o/p

Code:

  1000046


Only this exception need to be taken care.
In my case I did not have that in my test cases so ignored it.
icon_evil.gif

Thanks D

Regards,
Srikanth
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 Syncsort help SYNCSORT 3
No new posts Copy only TEXT or String from a record SYNCSORT 4
No new posts db2 vs static data COBOL Programming 1
No new posts SYNCSORT-DB2 interface SYNCSORT 0
No new posts External data queue (changes?) CLIST & REXX 0
Search our Forums:

Back to Top