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

SYNCSORT - packed to numeric


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

New User


Joined: 18 Apr 2009
Posts: 47
Location: India

PostPosted: Fri Jun 12, 2009 1:40 pm
Reply with quote

Hi Experts,

I am using the below sort card for converting the packed field to numeric and also i am removing the duplicates and writing it to the separate file.


I tried with the single step, in that case i got my output file (Without duplicates) perfectly..i.e, packed field is converted to numeric. But i didnt get my duplicate file correctly.i.e.data is still packed!!

But is there anyway to do this in a single step (instead of two steps here).
We are using SYNCSORT in our shop!!

Code:
//STEP001  EXEC PGM=SORT                                   
//SYSPRINT DD SYSOUT=*                                     
//SYSUDUMP DD SYSOUT=I                                     
//SYSOUT DD SYSOUT=*                                       
//SORTIN DD DSN=<input>,       
//          DISP=SHR                                       
//SORTOUT DD DSN=<output>,                                       
//          DCB=(RECFM=FB,LRECL=32,BLKSIZE=0),             
//          DISP=(NEW,CATLG,DELETE),                       
//          SPACE=(CYL,(400,200),RLSE)                     
//SORTXSUM DD DSN=<dup output1>,                                     
//           DISP=(NEW,CATLG,DELETE),                     
//           DCB=(RECFM=FB,LRECL=32,BLKSIZE=0),           
//           SPACE=(CYL,(400,200),RLSE)                   
//*                                                         
//SYSIN    DD *                                             
  SORT FIELDS=(1,06,PD,A)                                   
  SUM FIELDS=NONE,XSUM                                     
  OUTREC FIELDS=(1:1,6,PD,EDIT=(TTTTTTTTTTT),         
              12:7,6,PD,EDIT=(TTTTTTTTTTT),23:13,10)               
 /*                                                           
 //STEP002  EXEC PGM=SORT                                     
 //SYSPRINT DD SYSOUT=*                                       
 //SYSUDUMP DD SYSOUT=I                                       
 //SYSOUT DD SYSOUT=*                                         
 //SORTIN DD DSN=<dup output1>,   
 //          DISP=SHR                                         
 //SORTOUT DD DSN=<final duplicate file>,                                       
 //          DCB=(RECFM=FB,LRECL=32,BLKSIZE=0),               
 //          DISP=(NEW,CATLG,DELETE),                         
 //          SPACE=(CYL,(400,200),RLSE)                       
 //*                                                           
 //SYSIN    DD *                                               
   SORT FIELDS=COPY                                           
   OUTREC FIELDS=(1:1,6,PD,EDIT=(TTTTTTTTTTT),                 
                  12:7,6,PD,EDIT=(TTTTTTTTTTT),23:13,10)       
//*
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Fri Jun 12, 2009 2:15 pm
Reply with quote

since the omit function is during the sort,
i imagine if you converted during INREC (and change your sort fields parm)
your duplicate file would probably have the conversions also.
Back to top
View user's profile Send private message
rkarthik22

New User


Joined: 18 Apr 2009
Posts: 47
Location: India

PostPosted: Fri Jun 12, 2009 3:34 pm
Reply with quote

dbzTHEdinosauer wrote:
since the omit function is during the sort,
i imagine if you converted during INREC (and change your sort fields parm)
your duplicate file would probably have the conversions also.



I tried with INREC, its not working!!!
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Fri Jun 12, 2009 5:13 pm
Reply with quote

Quote:
its not working!!!


how about providing us with your control cards, an excerpt of your input and output?
Back to top
View user's profile Send private message
rkarthik22

New User


Joined: 18 Apr 2009
Posts: 47
Location: India

PostPosted: Fri Jun 12, 2009 5:32 pm
Reply with quote

Thsi time...instead of OUTREC, i used INREC as
Code:
//STEP001  EXEC PGM=SORT                                   
//SYSPRINT DD SYSOUT=*                                     
//SYSUDUMP DD SYSOUT=I                                     
//SYSOUT DD SYSOUT=*                                       
//SORTIN DD DSN=<input>,       
//          DISP=SHR                                       
//SORTOUT DD DSN=<output>,                                       
//          DCB=(RECFM=FB,LRECL=32,BLKSIZE=0),             
//          DISP=(NEW,CATLG,DELETE),                       
//          SPACE=(CYL,(400,200),RLSE)                     
//SORTXSUM DD DSN=<dup output1>,                                     
//           DISP=(NEW,CATLG,DELETE),                     
//           DCB=(RECFM=FB,LRECL=32,BLKSIZE=0),           
//           SPACE=(CYL,(400,200),RLSE)                   
//*                                                         
//SYSIN    DD *                                             
  SORT FIELDS=(1,06,PD,A)                                   
  SUM FIELDS=NONE,XSUM                                     
  INREC FIELDS=(1:1,6,PD,EDIT=(TTTTTTTTTTT),         
              12:7,6,PD,EDIT=(TTTTTTTTTTT),23:13,10)               
 /*


i got the duplicated records as numeric (packed to numeric). But in the first file where i will get records, without duplicates , in this file, i got empty records..So i think we cannot do this in a single step in SYNCSORT.
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 496
Location: USA

PostPosted: Mon Jun 15, 2009 8:45 pm
Reply with quote

Since you are now converting your data using INREC, which occurs before SORT processing, you must modify your SORT control statement to reflect the newly modified field. Try this:
Code:
SORT FIELDS=(1,11,ZD,A)
Back to top
View user's profile Send private message
r23051984

New User


Joined: 24 May 2009
Posts: 10
Location: chennai

PostPosted: Tue Jun 16, 2009 11:21 am
Reply with quote

Alissa,

I got the following error after changing the Sort card which u gave..

Code:
SYSIN :                                                             
  SORT FIELDS=(1,11,ZD,A)                                           
  SUM FIELDS=NONE,XSUM                                             
  INREC FIELDS=(1:1,6,PD,EDIT=(TTTTTTTTTTT),                       
                 12:7,6,PD,EDIT=(TTTTTTTTTTT),23,10)               
WER276B  SYSDIAG= 161394, 3122691, 3122691, 4413179                 
WER164B  10,840K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED,
WER164B     0 BYTES RESERVE REQUESTED, 1,004K BYTES USED           
WER146B  20K BYTES OF EMERGENCY SPACE ALLOCATED                     
WER108I  SORTIN   : RECFM=FB   ; LRECL=    22; BLKSIZE= 32758       
WER230A  INREC    FIELD OUTSIDE RANGE                               
WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000



Whati want is...

i want to convert the fields from packed to numeric and write to the output file and also i want to write the duplicates in separate file. Here i got the first output file (without duplicates) in a correct format. But in duplicate file,i got the records as packed, which is not expected!!
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 496
Location: USA

PostPosted: Tue Jun 16, 2009 9:50 pm
Reply with quote

I just ran this job using the sample data you sent to me and got the correct output in both files.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Wed Jun 17, 2009 1:34 am
Reply with quote

r23051984,
Code:
EDIT=(TTTTTTTTTTT),23,10)
Code:
WER108I  SORTIN   : RECFM=FB   ; LRECL=    22; BLKSIZE= 32758

Your input LRECL is just 22 and you are trying to access the 23rd position and hence the error:
Code:
WER230A  INREC    FIELD OUTSIDE RANGE 
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 496
Location: USA

PostPosted: Wed Jun 17, 2009 2:17 am
Reply with quote

r23051984,

I used your sample data inline (DD *), which creates an 80-byte record. That is probably why I did not get the error. Based on the data I saw, I believe you want to modify your INREC statement as follows:
Code:

  INREC FIELDS=(1:1,6,PD,EDIT=(TTTTTTTTTTT),                       
               12:7,6,PD,EDIT=(TTTTTTTTTTT),13,10)

Give that a shot and let us know whether or not you get the desired output.
Back to top
View user's profile Send private message
r23051984

New User


Joined: 24 May 2009
Posts: 10
Location: chennai

PostPosted: Wed Jun 17, 2009 11:34 am
Reply with quote

Hi alissa,

Thanks a lot!

finally it works after i changed the INREC statement .

This ICETOOl Sortcard is also working (As per my requirement)

Code:
//STEP001  EXEC PGM=ICETOOL                                         
//*                                                                 
//TOOLMSG   DD SYSOUT=*                                             
//DFSMSG    DD SYSOUT=*                                             
//SORTIN DD DSN=input file,             
//          DISP=SHR                                                 
//*                                                                 
//SORTWK1   DD DSN=&&SORTWK1,SPACE=(CYL,(5,5)),DISP=(,PASS)         
//SORTOUT DD DSN=output 1,                 
//           DCB=(RECFM=FB,LRECL=32,BLKSIZE=0),                     
//           DISP=(NEW,CATLG,DELETE),                               
//           SPACE=(CYL,(10,10),RLSE)                               
//SORTXSUM DD DSN=output 2,             
//            DISP=(NEW,CATLG,DELETE),                               
//            DCB=(RECFM=FB,LRECL=32,BLKSIZE=0),                     
//            SPACE=(CYL,(10,10),RLSE)                               
//*                                                                 
//TOOLIN   DD *                                                     
  COPY FROM(SORTIN) USING(CTL1)                                     
  SELECT FROM(SORTWK1) TO(SORTOUT) ON(1,11,CH) LAST DISCARD(SORTXSUM)
/*                                                                   
//CTL1CNTL  DD *                                                     
    OUTFIL FNAMES=SORTWK1,                                           
    OUTREC=(1:1,6,PD,EDIT=(TTTTTTTTTTT),12:7,6,PD,                   
                     EDIT=(TTTTTTTTTTT),23:13,10)                   
/*
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 Issues Converting From ZD to Signed N... DFSORT/ICETOOL 4
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts PD not working for unsigned packed JO... DFSORT/ICETOOL 5
No new posts Def PD not working for unsigned packe... JCL & VSAM 3
No new posts Need Help with Packed Decimal Signs DFSORT/ICETOOL 4
Search our Forums:

Back to Top