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 

determine lrecl

 
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
ptf
Beginner


Joined: 03 Jun 2004
Posts: 10
Topics: 5

PostPosted: Wed Jan 05, 2005 3:54 pm    Post subject: determine lrecl Reply with quote

How can I determine the lrecl of a file in a job and execute steps depending on the lrecl it finds?
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Wed Jan 05, 2005 4:16 pm    Post subject: Reply with quote

Ptf,

There are many ways of finding the LRECL of dataset. You can use Sort/easytrieve/sas to find the LRECL. Post clearly as to what you want to do after findout the LRECL

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ptf
Beginner


Joined: 03 Jun 2004
Posts: 10
Topics: 5

PostPosted: Wed Jan 05, 2005 4:40 pm    Post subject: Reply with quote

After I find out the LRECL, I want to execute the step in the jcl that processes that particular file and bypass the other steps.
Back to top
View user's profile Send private message
superk
Advanced


Joined: 19 Dec 2002
Posts: 684
Topics: 5

PostPosted: Wed Jan 05, 2005 4:53 pm    Post subject: Reply with quote

You can use a series of IDCAMS REPRO processes:
Code:

//MYJOB JOB( )...
//*
//STEP0001 EXEC PGM=IDCAMS                                     
//IN       DD   DISP=SHR,DSN=&SYSUID..LRECL80.TEST             
//OUT      DD   DISP=(NEW,PASS),UNIT=VIO,SPACE=(CYL,(1,1),RLSE),
//         RECFM=FB,LRECL=80                                   
//SYSPRINT DD   SYSOUT=*                                       
//SYSIN    DD   *                                               
  REPRO INFILE(IN) OUTFILE(OUT)  COUNT(1)                       
  IF LASTCC > 0 THEN SET MAXCC = 0                             
  ELSE               SET MAXCC = 4                             
/*                                                             
//*       
//STEP0002 EXEC PGM=IDCAMS                                         
//IN       DD   DISP=SHR,DSN=&SYSUID..LRECL80.TEST                 
//OUT      DD   DISP=(NEW,PASS),UNIT=VIO,SPACE=(CYL,(1,1),RLSE),   
//         RECFM=FB,LRECL=100                                     
//SYSPRINT DD   SYSOUT=*                                           
//SYSIN    DD   *                                                 
  REPRO INFILE(IN) OUTFILE(OUT)  COUNT(1)                         
  IF LASTCC > 0 THEN SET MAXCC = 0                                 
  ELSE               SET MAXCC = 4                                 
/*                                                                 
//*                                                               
//STEP0003 EXEC PGM=IDCAMS                                         
//IN       DD   DISP=SHR,DSN=&SYSUID..LRECL80.TEST                 
//OUT      DD   DISP=(NEW,PASS),UNIT=VIO,SPACE=(CYL,(1,1),RLSE),   
//         RECFM=FB,LRECL=120                                       
//SYSPRINT DD   SYSOUT=*                                           
//SYSIN    DD   *                                                   
  REPRO INFILE(IN) OUTFILE(OUT)  COUNT(1)                           
  IF LASTCC > 0 THEN SET MAXCC = 0                                 
  ELSE               SET MAXCC = 4                                 
/*
//*
// IF (STEP0001.RC = 0) THEN
//* DO LRECL=80 LOGIC
// ENDIF           
//*
// IF (STEP0002.RC = 0) THEN
//* DO LRECL=120 LOGIC
// ENDIF
                                                                                               

In this example, the job checks for 3 possible LRECL values: 80, 100, or 120. The IDCAMS REPRO function can only successfully copy the test dataset to an output dataset with the same LRECL attributes.
Back to top
View user's profile Send private message
ptf
Beginner


Joined: 03 Jun 2004
Posts: 10
Topics: 5

PostPosted: Wed Jan 05, 2005 4:56 pm    Post subject: Reply with quote

thanks! that should work.
Back to top
View user's profile Send private message
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