Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Can we check the existance of file in JCL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
Help-Me-Out

New User


Joined: 09 Dec 2006
Posts: 56
Location: Pune

PostPosted: Thu Jun 16, 2011 11:52 am    Post subject: Can we check the existance of file in JCL
Reply with quote

Hi,

I got one requirement where I need to look for the file which is coming from the 3rd party on daily basis with extn MON, TUE etc. if file does not receive by specific time then need to create empty file & process it.

I have tried using the LISTCAT command using the IDACAMS. it is working for the fixed file name.

Can we pass the parameter to the sort card. I have tried below but sortcard not working, giving error for the &DAY

//STEP1 EXEC PGM=IDCAMS,PARM=&DAY
//SYSIN DD *
LISTC ENT (TEST.DATA.&DAY)
//*

Can anybody suggest on this
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Thu Jun 16, 2011 11:57 am    Post subject: Re: Can we check the existance of file in JCL
Reply with quote

Help-Me-Out wrote:
Hi,

I got one requirement where I need to look for the file which is coming from the 3rd party on daily basis with extn MON, TUE etc. if file does not receive by specific time then need to create empty file & process it.

I have tried using the LISTCAT command using the IDACAMS. it is working for the fixed file name.

Can we pass the parameter to the sort card. I have tried below but sortcard not working, giving error for the &DAY

//STEP1 EXEC PGM=IDCAMS,PARM=&DAY
//SYSIN DD *
LISTC ENT (TEST.DATA.&DAY)
//*

Can anybody suggest on this


"sort card" is not a generic term fo SYSIN data. No, you can't do that. Try searching forum for IDCAMS examples from yesterday/day before.

How the file arriving? Most places don't have a chump sitting around checking manually for the existence of a file, but automate it.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Thu Jun 16, 2011 12:03 pm    Post subject:
Reply with quote

you can not modify the contents of instream data with symbolics.

the hard way would be to precede the idcams step with a sort step
that would populate a &&temp/ds/pds(member) with the appropriate LISTC parm,
and change the SYSIN from an instream dataset to the output of the preceding sort step &&temp/ds/pds(member)
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1894
Location: UK

PostPosted: Thu Jun 16, 2011 1:11 pm    Post subject:
Reply with quote

Also, suggest you read about PARM in the AMS manual. PARM is different for different programs - some do not even recognise it. Blindly using such a thing could led to serious consequences if you just happen to hit a value that means something to the program totally different to what you think.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Thu Jun 16, 2011 5:32 pm    Post subject: Re: Can we check the existance of file in JCL
Reply with quote

Help-Me-Out wrote:
I got one requirement where I need to look for the file which is coming from the 3rd party on daily basis with extn MON, TUE etc. if file does not receive by specific time then need to create empty file & process it.
1. Requirement is not totally told to us. What if you get the file once the empty file is already processed. Wait till tomorrow?

Quote:
I have tried using the LISTCAT command using the IDACAMS. it is working for the fixed file name.

Can we pass the parameter to the sort card. I have tried below but sortcard not working, giving error for the &DAY

//STEP1 EXEC PGM=IDCAMS,PARM=&DAY
//SYSIN DD *
LISTC ENT (TEST.DATA.&DAY)
//*Can anybody suggest on this
2. Where did you get the idea that IDCAMS will recognise "PARM=&DAY"? may be I mis-understood something.
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 Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts Garbage on output file Hervey Martinez SYNCSORT 4 Wed Sep 27, 2017 12:50 am
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am
No new posts Compare yesterday's date to the one o... migusd SYNCSORT 11 Fri Sep 22, 2017 11:35 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us