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

Syncsort: Problem in multiple file sort ( INREC)


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
nehal mulki
Warnings : 1

New User


Joined: 01 Jul 2008
Posts: 7
Location: Pune

PostPosted: Tue Jul 01, 2008 2:28 pm
Reply with quote

I have created this SORT card for copying only 443 bytes of data from input file. The input file is of length 451.

INCLUDE COND=(444,3,CH,EQ,C'ARE',AND,447,3,ZD,EQ,411)
INREC FIELDS=(1,443)
OPTION COPY
OUTFIL FILES=1


This sort card is working fine. But i need to replicate this sort card for 3 output files with same input file.

For eg.

INCLUDE COND=(444,3,CH,EQ,C'ABC',AND,447,3,ZD,EQ,401) - this record should go in FILE 1
INCLUDE COND=(444,3,CH,EQ,C'ABC',AND,447,3,ZD,EQ,411) -this record should go in FILE 2
INCLUDE COND=(444,3,CH,EQ,C'ABC',AND,447,3,ZD,EQ,421)-this record should go in FILE 3

I have tried , but failed.
Error was: " INCLUDE/OMIT FIELD BEYOND RECORD "
Plz help me.
Back to top
View user's profile Send private message
Vasukip
Currently Banned

New User


Joined: 17 Jun 2008
Posts: 48
Location: Chennai

PostPosted: Tue Jul 01, 2008 7:00 pm
Reply with quote

Hi,
Plz try this code
hope ds helps u out !
Code:

//S1 EXEC PGM=SYNCTOOL   
//TOOLMSG DD SYSOUT=*   
//DFSMSG DD  SYSOUT=*   
//IN1 DD  DSN = Input File,DISP=SHR
//OUT1 DD SYSOUT =*
//OUT2 DD SYSOUT =*
//OUT3 DD SYSOUT =*           
//TOOLIN DD *
SORT FROM(IN1) TO(OUT1) USING(CTL1) 
SORT FROM(IN1) TO(OUT2) USING(CTL2) 
SORT FROM(IN1) TO(OUT3) USING(CTL3) 
/*
//CTL1CNTL DD *
OPTION COPY
INCLUDE COND=(444,3,CH,EQ,C'ABC',AND,447,3,ZD,EQ,401),
BUILD=(1,443)
/*
//CTL2CNTL DD *
OPTION COPY
INCLUDE COND=(444,3,CH,EQ,C'ABC',AND,447,3,ZD,EQ,411),
BUILD=(1,443)
/*
//CTL3CNTL DD *
OPTION COPY
INCLUDE COND=(444,3,CH,EQ,C'ABC',AND,447,3,ZD,EQ,421),
BUILD=(1,443)
/*

Back to top
View user's profile Send private message
amalraj_ece

New User


Joined: 16 Jul 2006
Posts: 21
Location: delhi

PostPosted: Wed Jul 02, 2008 1:49 am
Reply with quote

try this
Code:

//STEP10 EXEC PGM=SYNCSORT                               
//SYSOUT   DD SYSOUT=*                                   
//SORTIN   DD DSN=AMAL.PS.TEST,DISP=SHR                   
//SORTOF01 DD DSN=AMAL.PS.TESTF01,DISP=(NEW,CATLG,DELETE),
//            SPACE=(CYL,5),UNIT=DISK                     
//SORTOF02 DD DSN=AMAL.PS.TESTF02,DISP=(NEW,CATLG,DELETE),
//            SPACE=(CYL,5),UNIT=DISK                     
//SORTOF03 DD DSN=AMAL.PS.TESTF03,DISP=(NEW,CATLG,DELETE),
//            SPACE=(CYL,5),UNIT=DISK
//SYSIN    DD  *                             
   SORT FIELDS=COPY                                                     
  OUTFIL FILES=01,OUTREC=(1,367),                                     
    INCLUDE=((1,1,CH,EQ,C' '),OR,(1,2,CH,EQ,C'##'),                     *
    OR,(1,2,CH,EQ,C'#$'),OR,(1,2,CH,EQ,C'#%'),OR,(1,2,CH,EQ,C'#*'))     
  OUTFIL FILES=02,OUTREC=(1,367),                                     
    INCLUDE=((1,2,CH,EQ,C'#0'),OR,(1,2,CH,EQ,C'#1'),                    *
      OR,(1,2,CH,EQ,C'#2'),OR,(1,2,CH,EQ,C'#3'),OR,(1,2,CH,EQ,C'#4'),   *
      OR,(1,2,CH,EQ,C'#5'),OR,(1,2,CH,EQ,C'#6'),OR,(1,2,CH,EQ,C'#7'),   *
      OR,(1,2,CH,EQ,C'#8'),OR,(1,2,CH,EQ,C'#9'))                         
  OUTFIL FILES=03,OUTREC=(1,367)
/*
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Wed Jul 02, 2008 9:58 am
Reply with quote

Hello nehal,

Were you able to arrive at proper results? If not, Can you please post here the card you used?

Thanks,
Arun
Back to top
View user's profile Send private message
nehal mulki
Warnings : 1

New User


Joined: 01 Jul 2008
Posts: 7
Location: Pune

PostPosted: Wed Jul 02, 2008 10:23 am
Reply with quote

hi arcvns,

my actual sort card is as below.

OUTFIL FILES=1,INCLUDE=(444,3,CH,EQ,C'AAA',AND,447,3,ZD,EQ,401)
OUTFIL FILES=2,INCLUDE=(444,3,CH,EQ,C'BBB',AND,447,3,ZD,EQ,411)
OUTFIL FILES=3,INCLUDE=(444,3,CH,EQ,C'CCC',AND,447,3,ZD,EQ,421)
INREC FIELDS=(1,443)
OPTION COPY


problem is , Include condition has fields which is at 444th and 447th location and i need to copy just 443 bytes from input file.

Error was: " INCLUDE/OMIT FIELD BEYOND RECORD "


for single file ...

INCLUDE COND=(444,3,CH,EQ,C'AAA',AND,447,3,ZD,EQ,401)
INREC FIELDS=(1,443)
OPTION COPY
OUTFIL FILES=1

This is working fine. Problem m facing is for multiple files.


got it ??
Back to top
View user's profile Send private message
nehal mulki
Warnings : 1

New User


Joined: 01 Jul 2008
Posts: 7
Location: Pune

PostPosted: Wed Jul 02, 2008 10:25 am
Reply with quote

hi Frank Yaeger ,

I need help from u ...


Thanks,
Nehal.
Back to top
View user's profile Send private message
nehal mulki
Warnings : 1

New User


Joined: 01 Jul 2008
Posts: 7
Location: Pune

PostPosted: Wed Jul 02, 2008 10:26 am
Reply with quote

hi Vasukip,

I tried using ICETOOL ,

Its working fine.

can u help me creating DFSORT card ??


Thanks,
Back to top
View user's profile Send private message
Vasukip
Currently Banned

New User


Joined: 17 Jun 2008
Posts: 48
Location: Chennai

PostPosted: Wed Jul 02, 2008 11:22 am
Reply with quote

Hi Nehal,

Plz have ds !

Code:

//STEPLIB EXEC PGM=SORT                         
//SORTIN DD *                                   
AAA   123      401                               
AAA   456      401                               
BBB   987      411                               
BBB   123      411                               
CCC   455      421                               
CCC   677      421                               
/*                                               
//SORTOF01 DD SYSOUT=*                           
//SORTOF02 DD SYSOUT=*                           
//SORTOF03 DD SYSOUT=*                           
//SYSIN DD *                                     
  SORT FIELDS=COPY                               
  OUTFIL FILES=01,                               
  INCLUDE=(1,3,CH,EQ,C'AAA',AND,16,3,ZD,EQ,401),
  OUTREC=(1,15)                                 
  OUTFIL FILES=02,                                 
  INCLUDE=(1,3,CH,EQ,C'BBB',AND,16,3,ZD,EQ,411),   
  OUTREC=(1,15)                                     
  OUTFIL FILES=03,                                 
  INCLUDE=(1,3,CH,EQ,C'CCC',AND,16,3,ZD,EQ,421),   
  OUTREC=(1,15)                                     
/*                                                 
//SYSPRINT DD SYSOUT=*                             
//SYSOUT   DD SYSOUT=*                             
//                                                 
Back to top
View user's profile Send private message
nehal mulki
Warnings : 1

New User


Joined: 01 Jul 2008
Posts: 7
Location: Pune

PostPosted: Wed Jul 02, 2008 11:28 am
Reply with quote

Hi Vasukip,

u r not getting my problem !!!

problem is , Include condition has fields which is at 444th and 447th location and i need to copy just 443 bytes from input file.


Error is " INCLUDE/OMIT FIELD BEYOND RECORD "

But gud to see ur quick responses !!!
Back to top
View user's profile Send private message
Vasukip
Currently Banned

New User


Joined: 17 Jun 2008
Posts: 48
Location: Chennai

PostPosted: Wed Jul 02, 2008 11:31 am
Reply with quote

hey,
cosider my example, Here in INCLUDE condition Im checking (16,3) position however for OUTREC I ve taken only first 15 (1,15) fields
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Wed Jul 02, 2008 11:58 am
Reply with quote

Hi Nehal

Quote:
OUTFIL FILES=1,INCLUDE=(444,3,CH,EQ,C'AAA',AND,447,3,ZD,EQ,401)
OUTFIL FILES=2,INCLUDE=(444,3,CH,EQ,C'BBB',AND,447,3,ZD,EQ,411)
OUTFIL FILES=3,INCLUDE=(444,3,CH,EQ,C'CCC',AND,447,3,ZD,EQ,421)
INREC FIELDS=(1,443)
OPTION COPY


The problem with the above code is after INREC FIELDS=, you have only positions 1 to 143 and you cant check for positions beyond that.
Try out this one and let us know.

Code:
//SYSIN DD *                                                   
  SORT FIELDS=COPY                                             
  OUTFIL FILES=1,INCLUDE=(444,3,CH,EQ,C'AAA',AND,447,3,ZD,EQ,401),
  OUTREC=(1,443)                                                 
  OUTFIL FILES=2,INCLUDE=(444,3,CH,EQ,C'BBB',AND,447,3,ZD,EQ,411),
  OUTREC=(1,443)                                                 
  OUTFIL FILES=3,INCLUDE=(444,3,CH,EQ,C'CCC',AND,447,3,ZD,EQ,421),
  OUTREC=(1,443)                                                 


Thanks,
Arun
Back to top
View user's profile Send private message
nehal mulki
Warnings : 1

New User


Joined: 01 Jul 2008
Posts: 7
Location: Pune

PostPosted: Wed Jul 02, 2008 1:40 pm
Reply with quote

hi man ,

Its giving error !!

OUTREC STATEMENT : SYNTAX ERROR
OUTREC STATEMENT : DUPLICATE STATEMENT FOUND
OUTREC STATEMENT : DUPLICATE STATEMENT FOUND
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Wed Jul 02, 2008 1:53 pm
Reply with quote

Nehal,

Can you post here the card and SYSOUT messages.

Thanks,
Arun
Back to top
View user's profile Send private message
nehal mulki
Warnings : 1

New User


Joined: 01 Jul 2008
Posts: 7
Location: Pune

PostPosted: Wed Jul 02, 2008 2:05 pm
Reply with quote

Card is same as u hav suggested !!

and the error msg , i hav already posted !!

Plz check !!

Thanks.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Jul 02, 2008 2:12 pm
Reply with quote

nehal mulki

Have you really posted the error message. What is the error code shown in the sysout that you HAVE NOT posted.

If you are not willing to help others to help you why bother posting on the forum ?

Your warning is for the above reason.
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 Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
Search our Forums:

Back to Top