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

If my input file is empty, copy a dummy record


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
karthik_sripal

New User


Joined: 28 Mar 2008
Posts: 69
Location: 125.16.180.5

PostPosted: Fri Nov 12, 2010 9:05 am
Reply with quote

My problem statement is that, If my input file is empty, copy a dummy record from dummy file else no operation is reqd.

This is infact simple, like using IDcams or sort to check the emptiness of a file, take that reurncode and based on return code in next step i can
copy the summy file.

But the problem is that, i shouldnt alter the RC of my job.if i do the above i would defenetly have my job RC altered.:$

so the tricky part is that, i need to do this copy of dummy only if my file is empty in one single step !!

Is this possible by any means ??

My gutt feel is that, almight sort would be having a solution, but couldnt get any solution.

Thanks!!
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Nov 12, 2010 9:48 am
Reply with quote

Hello,

It may be possible to get the result you want with no steps. . .

Why is there a need to do anything other than concatenate the 2 files as input?
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Fri Nov 12, 2010 12:19 pm
Reply with quote

Quote:
This is infact simple, like using IDcams or sort to check the emptiness of a file, take that reurncode and based on return code in next step i can
copy the summy file.
karthik_sripal,

I think you dont need an additional SORT. The below IDCAMS alone will do what you are trying.
Code:
//STEP01 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//INDD1    DD DSN=...  Input file
//INDD2    DD *
DUMMY RECORD
//OUTDD    DD DSN=...  Output file
//SYSIN    DD *
  PRINT IFILE(INDD1) COUNT(1)
  IF LASTCC=4 THEN -
              DO
                SET MAXCC=0
                REPRO IFILE(INDD2) OFILE(OUTDD)
              END
Back to top
View user's profile Send private message
karthik_sripal

New User


Joined: 28 Mar 2008
Posts: 69
Location: 125.16.180.5

PostPosted: Tue Nov 16, 2010 11:28 am
Reply with quote

Thank you Arun Raj. its definelty a Wow solution icon_smile.gif
Back to top
View user's profile Send private message
karthik_sripal

New User


Joined: 28 Mar 2008
Posts: 69
Location: 125.16.180.5

PostPosted: Tue Nov 16, 2010 11:30 am
Reply with quote

@dick scherrer

Quote:
It may be possible to get the result you want with no steps. . .

Why is there a need to do anything other than concatenate the 2 files as input?

Sorry.. could you please increase clarrity ?? I am not understanding your approach.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


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

PostPosted: Tue Nov 16, 2010 7:25 pm
Reply with quote

Statement 1 wrote:
shouldnt alter the RC of my job.

Statement 2 wrote:
Code:
IF LASTCC=4 THEN -
              DO
                SET MAXCC=0
...I'm confused, I certainly didn't understand the Statement 1, karthik_sripal - what MAXCC are you looking for?
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Nov 16, 2010 8:03 pm
Reply with quote

Anuj, methinks the OP wants only RC=0.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Nov 16, 2010 9:46 pm
Reply with quote

Hello,

Quote:
Sorry.. could you please increase clarrity ?? I am not understanding your approach.
My "approach" (if it will work for you - which depends on more info than has been posted) concatenates the the dataset with the unknown content and a dataset that is empty or contains only a "dummy" record.

Whether this could work depends on the code that reads the data eventuallly.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


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

PostPosted: Tue Nov 16, 2010 10:04 pm
Reply with quote

Okay expat. Was wondering what he is, actually, looking for...
Back to top
View user's profile Send private message
karthik_sripal

New User


Joined: 28 Mar 2008
Posts: 69
Location: 125.16.180.5

PostPosted: Wed Nov 17, 2010 11:13 pm
Reply with quote

Anuj Dhawan wrote:
Statement 1 wrote:
shouldnt alter the RC of my job.

Statement 2 wrote:
Code:
IF LASTCC=4 THEN - 
              DO 
                SET MAXCC=0
...I'm confused, I certainly didn't understand the Statement 1, karthik_sripal - what MAXCC are you looking for?


I was looking for Maxcc of 0 after my processing.

I was getting maxcc 0 in the AS-IS processing and missed to mention that in my thread, I guess now it is clear icon_smile.gif

Looks like i definetly need to improve on my communication.icon_smile.gif
Back to top
View user's profile Send private message
karthik_sripal

New User


Joined: 28 Mar 2008
Posts: 69
Location: 125.16.180.5

PostPosted: Wed Nov 17, 2010 11:20 pm
Reply with quote

expat wrote:
Anuj, methinks the OP wants only RC=0.


Thanks expat ,you got me correct !!
Back to top
View user's profile Send private message
karthik_sripal

New User


Joined: 28 Mar 2008
Posts: 69
Location: 125.16.180.5

PostPosted: Wed Nov 17, 2010 11:42 pm
Reply with quote

dick scherrer wrote:
Hello,

Quote:
Sorry.. could you please increase clarrity ?? I am not understanding your approach.
My "approach" (if it will work for you - which depends on more info than has been posted) concatenates the the dataset with the unknown content and a dataset that is empty or contains only a "dummy" record.

Whether this could work depends on the code that reads the data eventuallly.


Yes.. now i understand.. i guess it would not solve in the problem in my case.
Thanks for the clarrification dick scherrer.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Nov 17, 2010 11:55 pm
Reply with quote

You're welcome - good luck icon_smile.gif

d
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 TRIM everything from input, output co... DFSORT/ICETOOL 1
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 1
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
Search our Forums:

Back to Top