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
 

 

SYNCSORT - packed to numeric

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: SYNCSORT - packed to numeric
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: 6968
Location: porcelain throne

PostPosted: Fri Jun 12, 2009 2:15 pm    Post subject:
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    Post subject: re:
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: 6968
Location: porcelain throne

PostPosted: Fri Jun 12, 2009 5:13 pm    Post subject:
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    Post subject:
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: 500
Location: USA

PostPosted: Mon Jun 15, 2009 8:45 pm    Post subject:
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    Post subject:
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: 500
Location: USA

PostPosted: Tue Jun 16, 2009 9:50 pm    Post subject:
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: 2284
Location: @my desk

PostPosted: Wed Jun 17, 2009 1:34 am    Post subject:
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: 500
Location: USA

PostPosted: Wed Jun 17, 2009 2:17 am    Post subject:
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    Post subject:
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    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 Validate if a Value from the file is ... balacsv2 COBOL Programming 8 Mon Jun 19, 2017 11:52 pm
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts READ A PACKED "NEGATIVE" FI... jdesouza CA Products 3 Tue May 02, 2017 11:43 pm
No new posts Converting decimal to numeric using I... Balaryan DFSORT/ICETOOL 4 Thu Feb 02, 2017 11:27 pm
No new posts SYNCSORT SEQNUM and FI fields. nartcr SYNCSORT 7 Sat Jan 21, 2017 4:02 am


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