View previous topic :: View next topic
|
Author |
Message |
karthik_sripal
New User
Joined: 28 Mar 2008 Posts: 69 Location: 125.16.180.5
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
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 |
|
|
karthik_sripal
New User
Joined: 28 Mar 2008 Posts: 69 Location: 125.16.180.5
|
|
|
|
Thank you Arun Raj. its definelty a Wow solution |
|
Back to top |
|
|
karthik_sripal
New User
Joined: 28 Mar 2008 Posts: 69 Location: 125.16.180.5
|
|
|
|
@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 |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Anuj, methinks the OP wants only RC=0. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
Okay expat. Was wondering what he is, actually, looking for... |
|
Back to top |
|
|
karthik_sripal
New User
Joined: 28 Mar 2008 Posts: 69 Location: 125.16.180.5
|
|
|
|
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
Looks like i definetly need to improve on my communication. |
|
Back to top |
|
|
karthik_sripal
New User
Joined: 28 Mar 2008 Posts: 69 Location: 125.16.180.5
|
|
|
|
expat wrote: |
Anuj, methinks the OP wants only RC=0. |
Thanks expat ,you got me correct !! |
|
Back to top |
|
|
karthik_sripal
New User
Joined: 28 Mar 2008 Posts: 69 Location: 125.16.180.5
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
You're welcome - good luck
d |
|
Back to top |
|
|
|