MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Using IF condition in JCL thru SYNCSORT

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
sateesh_gontla
Beginner


Joined: 23 Jan 2004
Posts: 40
Topics: 16
Location: Bangalore

PostPosted: Fri Feb 06, 2004 6:01 am    Post subject: Using IF condition in JCL thru SYNCSORT Reply with quote

Hi


My Input File content will be like this : ( LRECL =80 )
========================================================


----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
********************************* Top of Data **********************************
Extract count is 26260
RowWriter count is 26260
The difference is 0
Ratio of Extractor Vs Transactions 1.44



Output File should be like this :
---------------------------------
If the difference is "0" and Ratio is between >=1.40 and <= 2.00

Extract count :26260
Ratio of Extractor Vs Transactions :1.44 (Normal)

If the difference is not "0" and Ratio is not inbetween >=1.40 and <= 2.00

Extract count :26260
RowWriter count :26260
The Difference :0
Ratio of Extractor Vs Transactions :1.44 (Abnormal)


Is it possible thru JCL Syncsort ???
_________________
Regards,
Sateesh
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12369
Topics: 75
Location: San Jose

PostPosted: Fri Feb 06, 2004 9:13 am    Post subject: Reply with quote

Sateesh,

The following JCL will give you desired results. I am assuming that your input file is 80 bytes in length and there will always be 4 records.

A brief explanation of the job. In step0100 We first create a temp dataset with a blksize in multiple of 320. By doing so we can override the lrecl in the next step so that we can read a set of 4 records as a single record. Also I am removing the decimal point to for easy comparision.

In step0200 we take the file created in the first step and override the lrecl to 320, so that we are reading 4 records as a single record. By doing so the the 2 line in your input file starts at 81 and 3 at 161 and 4th at 241 position. We now use an include condition to write out the records. While writting out we use the OUTFIL parm '/' to split the records back to 80 bytes.
Code:

//STEP0100  EXEC PGM=SORT                             
//SYSOUT    DD SYSOUT=*                               
//SORTIN    DD *                                       
EXTRACT COUNT IS 26260                                 
ROWWRITER COUNT IS 26260                               
THE DIFFERENCE IS 0                                   
RATIO OF EXTRACTOR VS TRANSACTIONS 1.44               
//SORTOUT  DD DSN=&T1,DISP=(,PASS),
//            SPACE=(CYL,(X,Y),RLSE),                 
//            DCB=(LRECL=80,RECFM=FB,BLKSIZE=27840)   
//SYSIN    DD  *                                     
  INREC FIELDS=(1,36,38,2,80:X)                         
  SORT FIELDS=COPY           
//*                         
//STEP0200  EXEC PGM=SORT                                             
//SYSOUT    DD SYSOUT=*                                               
//SORTIN    DD DSN=&T1,DISP=OLD,LRECL=320                             
//OUT1      DD SYSOUT=*                                               
//OUT2      DD SYSOUT=*                                               
//SYSIN     DD *                                                     
  SORT FIELDS=COPY                                                     
  OUTFIL FNAMES=OUT1,                                                     
  INCLUDE=(179,1,ZD,EQ,0,AND,(276,3,ZD,GE,140,OR,276,3,ZD,LE,200)),     
  OUTREC=(1,80,/,81,80)                                                 
  OUTFIL FNAMES=OUT2,SAVE,                                               
  OUTREC=(1,80,/,81,80,/,161,80,/,241,36,C'.',277,43)
//*



Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group