Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Copy a COMP data to numeric using SYNCSORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Copy a COMP data to numeric using SYNCSORT
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

Active Member


Joined: 08 May 2006
Posts: 992
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Mon Jul 28, 2008 4:50 pm    Post subject:
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: 1288
Location: Chennai, India

PostPosted: Mon Jul 28, 2008 4:52 pm    Post subject: Reply to: Copy a COMP data to numeric using SORT CARD ,OUTRE
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    Post subject: Re: Copy a COMP data to numeric using SORT CARD ,OUTREC
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    Post subject: Reply to: Copy a COMP data to numeric using SYNCSORT
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    Post subject: Reply to: Copy a COMP data to numeric using SYNCSORT
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

Moderator Team Head


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

PostPosted: Mon Jul 28, 2008 5:53 pm    Post subject: Reply to: Copy a COMP data to numeric using SYNCSORT
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

Site Director


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

PostPosted: Tue Jul 29, 2008 12:27 am    Post subject:
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    Post subject: Reply to: Copy a COMP data to numeric using SYNCSORT
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: 1288
Location: Chennai, India

PostPosted: Tue Jul 29, 2008 3:39 pm    Post subject: Reply to: Copy a COMP data to numeric using SYNCSORT
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

Site Director


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

PostPosted: Tue Jul 29, 2008 7:05 pm    Post subject: Reply to: Copy a COMP data to numeric using SYNCSORT
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    Post subject: Reply to: Copy a COMP data to numeric using SYNCSORT
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Data replication from multiple Db2 ta... kishpra DB2 1 Mon Mar 27, 2017 9:58 pm
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Append data from two files into a sin... Praveen04 DFSORT/ICETOOL 5 Thu Mar 16, 2017 7:29 pm
No new posts SPUFI -- Joining 3 tables – data in... Sysaron DB2 2 Wed Mar 08, 2017 4:18 am
No new posts Overriding PS data in rexx Shaheen Shaik CLIST & REXX 8 Fri Mar 03, 2017 5:08 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us