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
 

 

Sorting with different LRECL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
Learncoholic

New User


Joined: 20 Sep 2007
Posts: 73
Location: India

PostPosted: Tue Nov 27, 2007 11:11 am    Post subject: Sorting with different LRECL
Reply with quote

Hi I have a query on the following JCL

Code:
//STEP1 EXEC PGM=SYNCTOOL                                 
//DFSMSG DD SYSOUT=*                                     
//TOOLMSG DD SYSOUT=*                                   
//INDD DD *                                             
A.B.CCCCCCC.DDDDDDDD.EEEEEE                             
A.B.CCCCCCC.DDDDDDDD.FFFFFF                             
A.B.CCCCCCC.DDDDDDDD.GGGGGG                             
A.B.CCCCCCC.DDDDDDDD.HHHHHH                             
A.B.CCCCCCC.DDDDDDDD.IIIIII                             
/*                                                       
//OUTDD DD DSN=&&OUTDD,DISP=(NEW,PASS),SPACE=(CYL,(1,1)),
//         UNIT=SYSDA,DCB=(RECFM=FB,LRECL=80)           
//TEMP1 DD DSN=&&TEMP1,DISP=(NEW,PASS),SPACE=(CYL,(1,1))
//TOOLIN DD *                                           
  SORT FROM(INDD) TO(TEMP1) USING(CNT1)                 
  SORT FROM(TEMP1) TO(OUTDD) USING(CNT2)                 
/*                                                       
//CNT1CNTL DD *                                         
  SORT FIELDS=(81,5,PD,D)                               
  INREC OVERLAY(81:SEQNUM,5,PD)               
  OUTFIL REMOVECC,IFTHEN=(WHEN=(81,5,PD,EQ,1),
  BUILD=(C' NAME (',1,27)),                   
  IFTHEN=(WHEN=NONE,BUILD=(C' ',1,27,C','))   
/*                                           
//CNT2CNTL DD *                               
  SORT FIELDS=(81,5,PD,D)                     
  INREC OVERLAY(81:SEQNUM,5,PD)               
  OUTFIL REMOVECC,IFTHEN=(WHEN=(81,5,PD,EQ,1),
  OVERLAY(29:C')'))                           
/*                                           


The JCL Gives an error as:

Code:
SORT FIELDS=(81,5,PD,D)                                               0024000
  INREC OVERLAY(81:SEQNUM,5,PD)                                         0025000
  OUTFIL REMOVECC,IFTHEN=(WHEN=(81,5,PD,EQ,1),                          0026000
  OVERLAY(29:C')'))                                                     0027000
PARMLIST :                                                                     
OPTION RESINV=0,ARESINV=0,MSGDDN=DFSMSG,SORTIN=TEMP1,SORTOUT=OUTDD,SORTDD=CNT2,
YNALLOC                                                                       
WER428I  CALLER-PROVIDED IDENTIFIER IS "0002"                                 
WER276B  SYSDIAG= 197596, 949450, 949450, 1257165                             
WER164B  7,976K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED,             
WER164B     0 BYTES RESERVE REQUESTED, 500K BYTES USED                         
WER146B  12K BYTES OF EMERGENCY SPACE ALLOCATED                               
WER108I  TEMP1    : RECFM=FB   ; LRECL=    34; BLKSIZE= 27982                 
WER257I  INREC RECORD LENGTH =    85                                           
WER238I  POTENTIALLY INEFFICIENT USE OF INREC                                 
WER110I  OUTDD    : RECFM=FB   ; LRECL=    80; BLKSIZE= 27920                 
WER247A  OUTDD    HAS INCOMPATIBLE LRECL                                       
WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000                                 


I want the o/p as :

Code:
NAME (A.B.CCCCCCC.DDDDDDDD.EEEEEE
A.B.CCCCCCC.DDDDDDDD.FFFFFF,     
A.B.CCCCCCC.DDDDDDDD.GGGGGG,     
A.B.CCCCCCC.DDDDDDDD.HHHHHH,     
A.B.CCCCCCC.DDDDDDDD.IIIIII)     


The LRECL of the o/p file should be 80. Can this be attained using only 1 use of SYNCTOOL and 2 control cards?
Back to top
View user's profile Send private message

murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Tue Nov 27, 2007 11:21 am    Post subject:
Reply with quote

Learnholic,

Change the following statement of CNT1CNTL -
Code:
OUTFIL REMOVECC,IFTHEN=(WHEN=(81,5,PD,EQ,1),
  BUILD=(C' NAME (',1,27)),                   
  IFTHEN=(WHEN=NONE,BUILD=(C' ',1,27,C','))   


to

Code:
OUTFIL REMOVECC,IFTHEN=(WHEN=(81,5,PD,EQ,1),
  BUILD=(C' NAME (',1,27,80:X)),                   
  IFTHEN=(WHEN=NONE,BUILD=(C' ',1,27,C',',80:X))   
Back to top
View user's profile Send private message
Learncoholic

New User


Joined: 20 Sep 2007
Posts: 73
Location: India

PostPosted: Tue Nov 27, 2007 11:28 am    Post subject:
Reply with quote

Hi murmohk1,

I changed the CNT1 card as you said. But unfortunately it is showing the same error.
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1288
Location: Chennai, India

PostPosted: Tue Nov 27, 2007 11:52 am    Post subject: Reply to: Sorting with different LRECL
Reply with quote

Learncoholic,

Use this Sort card

Code:
//STEP1 EXEC PGM=ICETOOL                                             
//DFSMSG DD SYSOUT=*                                                 
//TOOLMSG DD SYSOUT=*                                               
//INDD DD *                                                         
A.B.CCCCCCC.DDDDDDDD.EEEEEE                                         
A.B.CCCCCCC.DDDDDDDD.FFFFFF                                         
A.B.CCCCCCC.DDDDDDDD.GGGGGG                                         
A.B.CCCCCCC.DDDDDDDD.HHHHHH                                         
A.B.CCCCCCC.DDDDDDDD.IIIIII                                         
/*                                                                   
//OUTDD DD DSN=HLQ1.NEW.N94R,DISP=(,CATLG,DELETE),                 
//         UNIT=SYSDA,DCB=(RECFM=FB,LRECL=80)                       
//TEMP1 DD DSN=&&TEM49,DISP=(NEW,PASS),SPACE=(CYL,(1,1))             
//TOOLIN DD *                                                       
  SORT FROM(INDD) TO(TEMP1) USING(CNT1)                             
  SORT FROM(TEMP1) TO(OUTDD) USING(CNT2)                             
/*                                                                   
//CNT1CNTL DD *                                                     
  SORT FIELDS=(80,1,PD,D)                                           
  INREC OVERLAY(80:SEQNUM,1,PD)                                     
  OUTFIL REMOVECC,IFTHEN=(WHEN=(80,1,PD,EQ,1),                       
  BUILD=(C' NAME (',1,27,80:X)),                           
  IFTHEN=(WHEN=NONE,BUILD=(C' ',1,27,C',',80:X))           
/*                                                         
//CNT2CNTL DD *                                             
  SORT FIELDS=(80,1,PD,D)                                   
  INREC OVERLAY(80:SEQNUM,1,PD)                             
  OUTFIL REMOVECC,IFTHEN=(WHEN=(80,1,PD,EQ,1),             
  BUILD=(1,28,C')',80:X)),                                 
  IFTHEN=(WHEN=NONE,BUILD=(1,75,80:X))                     
/*                                                 
Back to top
View user's profile Send private message
Learncoholic

New User


Joined: 20 Sep 2007
Posts: 73
Location: India

PostPosted: Tue Nov 27, 2007 12:06 pm    Post subject:
Reply with quote

Hi Aaru

The sort card you have given is working absolutely fine. Thanks Once again for helping me out.
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1288
Location: Chennai, India

PostPosted: Tue Nov 27, 2007 12:20 pm    Post subject: Reply to: Sorting with different LRECL
Reply with quote

Learncoholic,

Quote:
Thanks Once again for helping me out.


You are welcome icon_biggrin.gif . It would be great if you can build on this and learn these concepts.

I found the following from your sort card.

Code:
SORT FIELDS=(81,5,PD,D)                     
  INREC OVERLAY(81:SEQNUM,5,PD)       


You are Overlaying the data after sorting. It depends on your requirement but usually we sort after overlaying the data.

Code:
WER257I  INREC RECORD LENGTH =    85                                           
WER238I  POTENTIALLY INEFFICIENT USE OF INREC                                 
WER110I  OUTDD    : RECFM=FB   ; LRECL=    80; BLKSIZE= 27920                 
WER247A  OUTDD    HAS INCOMPATIBLE LRECL                   


This has been explained already and also self-explanatory.
Back to top
View user's profile Send private message
Learncoholic

New User


Joined: 20 Sep 2007
Posts: 73
Location: India

PostPosted: Tue Nov 27, 2007 12:50 pm    Post subject:
Reply with quote

Hi Aaru,

INREC is performed before sort operation & OUTREC after sort operation. Isn't it? Well that's where I am in doubt. How do I change this operation? Shall I use:

Code:
INREC OVERLAY(81:SEQNUM,5,PD)
 SORT FIELDS=(81,5,PD,D)

instead?
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1288
Location: Chennai, India

PostPosted: Tue Nov 27, 2007 3:16 pm    Post subject: Reply to: Sorting with different LRECL
Reply with quote

Learncoholic,

Quote:
INREC is performed before sort operation & OUTREC after sort operation. Isn't it?


Yes, you are right. But i was not mentioning that.

Code:
SORT FIELDS=(81,5,PD,D)                     
  INREC OVERLAY(81:SEQNUM,5,PD)


First you are sorting based on the values in the 5 bytes starting from 81. But only in the OVERLAY you are adding the sequence no. According to me, there is no point in sorting before adding the sequence no.

Do not alter the working JCL icon_smile.gif
Back to top
View user's profile Send private message
Learncoholic

New User


Joined: 20 Sep 2007
Posts: 73
Location: India

PostPosted: Tue Nov 27, 2007 3:51 pm    Post subject:
Reply with quote

Hi Aaru

Then
Code:
INREC OVERLAY(81:SEQNUM,5,PD)
 SORT FIELDS=(81,5,PD,D)

this code should be fine I suppose?

Quote:
Do not alter the working JCL

Of course not icon_smile.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 Nov 27, 2007 3:54 pm    Post subject: Reply to: Sorting with different LRECL
Reply with quote

Learncoholic,

Quote:
this code should be fine I suppose?


Yes, that would also work fine.
Back to top
View user's profile Send private message
shankar.v

Active User


Joined: 25 Jun 2007
Posts: 196
Location: Bangalore

PostPosted: Tue Nov 27, 2007 5:17 pm    Post subject:
Reply with quote

Learncoholic,

You are doing (copy + adding sequence numbers) two times and also sorting two times based on the sequence numbers.

The following sort jcl which may suit your requirement contains two steps, both with copy and adding sequence numbers on the second step only and also no sort is involved. This may give you a better performance while doing a run with large number of records.

And also I think you will need a "," in position 35 in first record. The following jcl includes that also. If you are going to use this code and don't want that "," change the code accordingly.
Code:
//S EXEC PGM=SORT                                             
//SORTIN  DD *                                               
A.B.CCCCCCC.DDDDDDDD.EEEEEE                                   
A.B.CCCCCCC.DDDDDDDD.FFFFFF                                   
A.B.CCCCCCC.DDDDDDDD.GGGGGG                                   
A.B.CCCCCCC.DDDDDDDD.HHHHHH                                   
A.B.CCCCCCC.DDDDDDDD.IIIIII                                   
/*                                                           
//SORTOUT DD DSN=&&SYMNAMES,DISP=(,PASS),SPACE=(TRK,(1,1))   
//SYSOUT DD SYSOUT=*                                         
//SYSIN DD *                                                 
 OPTION COPY                                                 
 OUTFIL REMOVECC,NODETAIL,BUILD=(80X),                       
 TRAILER1=(C'LASTREC,+',COUNT=(M11,LENGTH=8))                 
/*                                                           
// EXEC PGM=SORT                                             
//SORTIN  DD *                                               
A.B.CCCCCCC.DDDDDDDD.EEEEEE                                   
A.B.CCCCCCC.DDDDDDDD.FFFFFF                                   
A.B.CCCCCCC.DDDDDDDD.GGGGGG                                       
A.B.CCCCCCC.DDDDDDDD.HHHHHH                                       
A.B.CCCCCCC.DDDDDDDD.IIIIII                                       
/*                                                                 
//SYMNAMES DD DSN=*.S.SORTOUT,DISP=(OLD,DELETE),VOL=REF=*.S.SORTOUT
//SORTOUT DD SYSOUT=*                                             
//SYSOUT DD SYSOUT=*                                               
//SYSIN DD *                                                       
 OPTION COPY                                                       
 INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,8,ZD)),               
 IFTHEN=(WHEN=(81,8,ZD,EQ,+1),BUILD=(C' NAME (',1,27,C',',80:X)), 
 IFTHEN=(WHEN=(81,8,ZD,EQ,LASTREC),BUILD=(X,1,27,C')',80:X)),     
 IFTHEN=(WHEN=(81,8,ZD,GT,+1),BUILD=(X,1,27,C',',80:X))           
 OUTFIL BUILD=(1,80) 

Output:
Code:
 NAME (A.B.CCCCCCC.DDDDDDDD.EEEEEE,   
 A.B.CCCCCCC.DDDDDDDD.FFFFFF,         
 A.B.CCCCCCC.DDDDDDDD.GGGGGG,         
 A.B.CCCCCCC.DDDDDDDD.HHHHHH,         
 A.B.CCCCCCC.DDDDDDDD.IIIIII) 
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1288
Location: Chennai, India

PostPosted: Tue Nov 27, 2007 5:29 pm    Post subject: Reply to: Sorting with different LRECL
Reply with quote

Shankar,

Learncoholic wrote:
Quote:
Can this be attained using only 1 use of SYNCTOOL and 2 control cards?


Yes, the sort card can be used for better performance but OP wanted to do this using SYNCTOOL/2 control cards.
Back to top
View user's profile Send private message
shankar.v

Active User


Joined: 25 Jun 2007
Posts: 196
Location: Bangalore

PostPosted: Tue Nov 27, 2007 5:58 pm    Post subject:
Reply with quote

Learncoholic,
Quote:
Can this be attained using only 1 use of SYNCTOOL and 2 control cards?

You are doing (copy + adding sequence numbers) two times and also sorting two times based on the sequence numbers.

The following alternative sort jcl to the one posted before which may suit your requirement contains one step with two I/Os, both with copy and adding sequence numbers on the second I/O only and also no sort is involved. This may give you a better performance while doing a run with large number of records.

And also I think you will need a "," in position 35 in first record. The following jcl includes that also. If you are going to use this code and don't want that "," change the code accordingly.

Code:
// EXEC PGM=SYNCTOOL                               
//DFSMSG DD SYSOUT=*                               
//TOOLMSG DD SYSOUT=*                             
//INFILE  DD *                                     
A.B.CCCCCCC.DDDDDDDD.EEEEEE                       
A.B.CCCCCCC.DDDDDDDD.FFFFFF                       
A.B.CCCCCCC.DDDDDDDD.GGGGGG                       
A.B.CCCCCCC.DDDDDDDD.HHHHHH                       
A.B.CCCCCCC.DDDDDDDD.IIIIII                       
/*                                                 
//T DD DSN=&&T,DISP=(,PASS),SPACE=(CYL,(1,1))     
//OUT DD SYSOUT=*                                 
//TOOLIN DD *                                     
 COPY FROM(INFILE) TO(T) USING(CTL1)               
 COPY FROM(INFILE) TO(OUT) USING(CTL2)             
/*                                                 
//CTL1CNTL DD *                                   
 OUTFIL REMOVECC,NODETAIL,BUILD=(80X),             
 OUTFIL REMOVECC,NODETAIL,BUILD=(80X),                           
 TRAILER1=(C' IFTHEN=(WHEN=(81,8,ZD,EQ,+',COUNT=(M11,LENGTH=8),   
 C'),BUILD=(X,1,27,C'')'',80:X)),',80:X)                         
/*                                                               
//CTL2CNTL DD *                                                   
 INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,8,ZD)),               
 IFTHEN=(WHEN=(81,8,ZD,EQ,+1),BUILD=(C' NAME (',1,27,C',',80:X)),
/*                                                               
// DD DSN=*.T,DISP=(OLD,DELETE),VOL=REF=*.T                       
// DD *                                                           
 IFTHEN=(WHEN=(81,8,ZD,GT,+1),BUILD=(X,1,27,C',',80:X))           
 OUTFIL BUILD=(1,80)                                             
/*                                                               
//                                                               

Output:
Code:
 NAME (A.B.CCCCCCC.DDDDDDDD.EEEEEE,   
 A.B.CCCCCCC.DDDDDDDD.FFFFFF,         
 A.B.CCCCCCC.DDDDDDDD.GGGGGG,         
 A.B.CCCCCCC.DDDDDDDD.HHHHHH,         
 A.B.CCCCCCC.DDDDDDDD.IIIIII)   
Back to top
View user's profile Send private message
Learncoholic

New User


Joined: 20 Sep 2007
Posts: 73
Location: India

PostPosted: Tue Nov 27, 2007 6:31 pm    Post subject:
Reply with quote

Hi shankar.v,

It's too hot for me to handle this. Can you please explain it to me in short?
Back to top
View user's profile Send private message
shankar.v

Active User


Joined: 25 Jun 2007
Posts: 196
Location: Bangalore

PostPosted: Tue Nov 27, 2007 7:02 pm    Post subject:
Reply with quote

Please take one OUTFIL REMOVECC,NODETAIL,BUILD=(80X) in CTL1 as i wrongly posted because of copy/paste mistake.
Quote:
Hi shankar.v,

It's too hot for me to handle this. Can you please explain it to me in short?


CTL1 will build a part of sort card required for CTL2 and is the following one.
Code:
 IFTHEN=(WHEN=(81,8,ZD,EQ,<count of number of records in input file.i.e,last record>),
 BUILD=(X,1,27,C')',80:X)),

CTL2CNTL is associated with three DD concatenate and final will looks like
Code:
 INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,8,ZD)),               
 IFTHEN=(WHEN=(81,8,ZD,EQ,+1),BUILD=(C' NAME (',1,27,C',',80:X)), 
 IFTHEN=(WHEN=(81,8,ZD,EQ,<count of number of records in input file.i.e,last record>),
 BUILD=(X,1,27,C')',80:X)),   
 IFTHEN=(WHEN=(81,8,ZD,GT,+1),BUILD=(X,1,27,C',',80:X))           
 OUTFIL BUILD=(1,80)
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 Sorting group data rajella DFSORT/ICETOOL 4 Sun Jan 22, 2017 11:32 pm
No new posts Efficient sorting chandracdac DFSORT/ICETOOL 5 Sat Oct 22, 2016 3:23 am
No new posts Stripping and Sorting of VB file G SRINIVASA RAO SYNCSORT 5 Wed Sep 14, 2016 1:34 pm
No new posts DFSORT sorting only specific records akodakka DFSORT/ICETOOL 4 Thu Aug 04, 2016 11:24 am
No new posts PL/I: opening file w/ dynamically det... Sam Dodgers PL/I & Assembler 6 Wed Jul 27, 2016 4:05 pm


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