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

How to check the record length in a jcl


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
vineetjoshi01

New User


Joined: 06 Nov 2009
Posts: 14
Location: Singapore

PostPosted: Wed Jun 13, 2012 4:29 pm
Reply with quote

Hi All,

I have an issue with one of my JCLs. I need to check the record length of my input file in the JCL and if it is say 77 then I have to execute next step in the JCL else I don't have to excute next step.
Example:
Say I have file-1 of record length 77 and file-2 of record length 87.
Now in my JCL if the input is file-1 then I have to execute next step and if the input is file-2 then I do not have to execute the next step. Could you please suggest how I can get the record length of file in JCL and use that in decision making for next step.

Regards,
Vineet
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Wed Jun 13, 2012 4:36 pm
Reply with quote

Are you allowed to use Rexx?
Back to top
View user's profile Send private message
Naish

New User


Joined: 07 Dec 2006
Posts: 82
Location: UK

PostPosted: Wed Jun 13, 2012 4:39 pm
Reply with quote

Did you Googled?

I at the least found 2 solutions that can be useful.
Back to top
View user's profile Send private message
vineetjoshi01

New User


Joined: 06 Nov 2009
Posts: 14
Location: Singapore

PostPosted: Wed Jun 13, 2012 5:49 pm
Reply with quote

Hi Akatsukami,
I cannot use REXX. Is there some other way which you could suggest.

Hi Naish,
I have certain methods like I can use listds and route the output to a dataset and then read that dataset using sort but that would be bit clumsy method. Is there any method which you could please suggest. That would be great. I also have thought of another method which I am trying meanwhile.

Thanks,
Vineet
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Wed Jun 13, 2012 6:26 pm
Reply with quote

This sounds very odd. Why don't you know which file is being read? You'll have to explain more.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Wed Jun 13, 2012 6:30 pm
Reply with quote

strongly agree with You Bill, very poor design icon_cool.gif
Back to top
View user's profile Send private message
Naish

New User


Joined: 07 Dec 2006
Posts: 82
Location: UK

PostPosted: Wed Jun 13, 2012 6:31 pm
Reply with quote

Can you tell us what would you 'DO' in your next step? E.g. execute COBOL, SORT, etc.

As in one of the solutions from superk in a trainee forum you can use IDCAMS and conditional statements (I guess thats another method you are trying).

I have encountered similar case once. But we were receiving both the files and would use symbolic parameters when calling a common proc and use that in a conditional statement further. But that was my case.

Can you also tell us whether the file (basically DSN) in your first step changes if the lrecl changes? if no then why/who is changing the LRECL in the first place. if yes then why? I feel thats confusing. Am I missing something? Please help me understand if I am.
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Wed Jun 13, 2012 6:31 pm
Reply with quote

Hi,
The below step gives RC=0 for LRECL 77 assuming FB.
and RC=8 for anyother LRECL
RC=4 if you have empty input file.

you have to handle this step's return code in downstream steps.

Code:

//JS001    EXEC PGM=IDCAMS                                     
//INP1     DD DISP=SHR,DSN=WELLS.INPUT.FILE                     
//OUT1     DD DISP=(NEW,DELETE,DELETE),SPACE=(TRK,(1,1),RLSE),
//     DCB=(LRECL=77,BLKSIZE=0,RECFM=FB)                       
//SYSPRINT DD SYSOUT=*                                         
//SYSIN DD *                                                   
 REPRO INFILE(INP1)  OUTFILE(OUT1) COUNT(1)                   
/*                                                             


Hope it helps.
Back to top
View user's profile Send private message
vineetjoshi01

New User


Joined: 06 Nov 2009
Posts: 14
Location: Singapore

PostPosted: Thu Jun 14, 2012 10:27 am
Reply with quote

Hi enrico,
That was surely bad design... thats why I didnt opt for that... icon_smile.gif

Hi Naish,
In next step I was trying to execute ICETOOL step... The other method which I was trying was using IDCAMS. I have done that now.

Hi vasanthz,
Thanks for the help icon_smile.gif
I have used the same technique which you have suggested... icon_smile.gif Thanks again!!!

Regards,
Vineet
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 How to split large record length file... DFSORT/ICETOOL 10
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts To find whether record count are true... DFSORT/ICETOOL 6
Search our Forums:

Back to Top