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

Can we check the existance of file in JCL


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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

Moderator Emeritus


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

PostPosted: Thu Jun 16, 2011 11:57 am
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
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: 2455
Location: Hampshire, UK

PostPosted: Thu Jun 16, 2011 1:11 pm
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

Superior Member


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

PostPosted: Thu Jun 16, 2011 5:32 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top