View previous topic :: View next topic
|
Author |
Message |
vineetjoshi01
New User
Joined: 06 Nov 2009 Posts: 14 Location: Singapore
|
|
|
|
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 |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
Are you allowed to use Rexx? |
|
Back to top |
|
|
Naish
New User
Joined: 07 Dec 2006 Posts: 82 Location: UK
|
|
|
|
Did you Googled?
I at the least found 2 solutions that can be useful. |
|
Back to top |
|
|
vineetjoshi01
New User
Joined: 06 Nov 2009 Posts: 14 Location: Singapore
|
|
|
|
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
This sounds very odd. Why don't you know which file is being read? You'll have to explain more. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
|
|
strongly agree with You Bill, very poor design |
|
Back to top |
|
|
Naish
New User
Joined: 07 Dec 2006 Posts: 82 Location: UK
|
|
|
|
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 |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1742 Location: Tirupur, India
|
|
|
|
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 |
|
|
vineetjoshi01
New User
Joined: 06 Nov 2009 Posts: 14 Location: Singapore
|
|
|
|
Hi enrico,
That was surely bad design... thats why I didnt opt for that...
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
I have used the same technique which you have suggested... Thanks again!!!
Regards,
Vineet |
|
Back to top |
|
|
|