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
 

 

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: 7306

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: 6966
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: 1749
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 Check Binary Values for symbols gandikk CA Products 3 Tue Mar 21, 2017 5:11 am
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Formatting VB File Learncoholic DFSORT/ICETOOL 3 Mon Mar 20, 2017 12:29 pm
No new posts Updating a VSAM file with DISP=OLD sheersh JCL & VSAM 8 Tue Mar 14, 2017 6:14 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm


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