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

Syncsort - How to Numberic to PD using sort card


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

New User


Joined: 20 Sep 2006
Posts: 23
Location: Chennai

PostPosted: Sun May 20, 2012 3:56 pm
Reply with quote

Hi,
Input file contains 1st 6 byte as numeric, I want to read it and convert into packed decimal (comp-3).
I tried to convert in sort by using below code. I worked fine but expected values in sign byte 'C' but i am getting 'F in hex values.’
Can someone guide me on this?

Code:OPTION COPY
OUTREC OVERLAY=(1,6,FS,TO=PD,LENGTH=4)

Input file:
100111abc...

Output file (hex format)
1011
011F

Excepted is
1011
011C
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Sun May 20, 2012 9:32 pm
Reply with quote

Have a look in the manual to confirm, then try TO=PDC
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Mon May 21, 2012 11:56 pm
Reply with quote

D.Senthil kumar.

DFSORT would give you a C sign with TO=PD, so if you're getting an F sign, I can only conclude that you're using Syncsort (WER messages), not DFSORT (ICE messages).

This is the DFSORT Forum for DFSORT questions. Please use the JCL Forum for Syncsort questions.
Back to top
View user's profile Send private message
senthilnathanj

New User


Joined: 31 Jul 2007
Posts: 47
Location: chennai

PostPosted: Wed May 23, 2012 1:40 pm
Reply with quote

Hi,
Please try the below code:
Code:
//STEP1    EXEC PGM=SORT                                               
//SYSOUT   DD SYSOUT=*                                                 
//SYSPRINT DD SYSOUT=*                                                 
//SORTIN DD *                                                           
452921                                                                   
351052                                                                   
260114                                                                   
623460                                                                   
812325                                                                   
352328                                                                   
//SORTOUT  DD DSN=XXXX.TEST.PDVALUES,DISP=(,CATLG,DELETE),           
//            UNIT=SYSDA,SPACE=(CYL,(1,1),RLSE)                         
//SYSIN DD *                                                           
  OPTION COPY                                                           
  OUTREC FIELDS=(1,5,UFF,TO=PD) 


Copybook Layout:

Code:
****** ***************************** Top of Data ************
000001        01 OUTREC.                                       
000002           05 FIELD1   PIC 9(4)V99 COMP-3.             
****** **************************** Bottom of Data **********


u will get the excepted output.Next time onwards,Please post in the correct section.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed May 23, 2012 1:49 pm
Reply with quote

sorry if this sort-rookie poses a question,
but
if the input is 6 char
Code:
//SORTIN DD *                                                           
452921           


how does this work?

Code:
OUTREC FIELDS=(1,5,UFF,TO=PD)


why would it not be
Code:
OUTREC FIELDS=(1,6,UFF,TO=PD)


or does syncsort have its own method of doing things?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Wed May 23, 2012 8:43 pm
Reply with quote

Hello,

Syncsort is similar to DFSORT in many (most) control statements - though there are some cases where the "same" functionality has somewhat different syntax.

Yup, i believe the 1,6 is correct (rather than the 1,5).
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 Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
Search our Forums:

Back to Top