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
 

 

How to check the record length in a jcl

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: How to check the record length in a jcl
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: 1738
Location: Bloomington, IL

PostPosted: Wed Jun 13, 2012 4:36 pm    Post subject:
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    Post subject:
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    Post subject: Reply to: How to check the record length in a jcl
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7234

PostPosted: Wed Jun 13, 2012 6:26 pm    Post subject: Reply to: How to check the record length in a jcl
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Wed Jun 13, 2012 6:30 pm    Post subject: Reply to: How to check the record length in a jcl
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    Post subject:
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: 1445
Location: Azeroth

PostPosted: Wed Jun 13, 2012 6:31 pm    Post subject:
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    Post subject: Reply to: How to check the record length in a jcl
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    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 What is the command to check MODE of ... rohanthengal CLIST & REXX 6 Fri Nov 18, 2016 1:48 pm
No new posts Check System time(Minute) Using TIME1... balaji81_k DFSORT/ICETOOL 5 Fri Nov 11, 2016 10:53 am
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts SQZ pipe delimited file with 1 column... Rick Silvers DFSORT/ICETOOL 2 Sun Nov 06, 2016 8:11 pm
No new posts Joinkeys operation when key1 and key2... Susanta DFSORT/ICETOOL 5 Wed Nov 02, 2016 5:35 pm


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