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
 

 

If my input file is empty, copy a dummy record

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

New User


Joined: 28 Mar 2008
Posts: 67
Location: 125.16.180.5

PostPosted: Fri Nov 12, 2010 9:05 am    Post subject: If my input file is empty, copy a dummy record
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

Site Director


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

PostPosted: Fri Nov 12, 2010 9:48 am    Post subject:
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: 2158
Location: @my desk

PostPosted: Fri Nov 12, 2010 12:19 pm    Post subject:
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: 67
Location: 125.16.180.5

PostPosted: Tue Nov 16, 2010 11:28 am    Post subject:
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: 67
Location: 125.16.180.5

PostPosted: Tue Nov 16, 2010 11:30 am    Post subject:
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

Senior Member


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

PostPosted: Tue Nov 16, 2010 7:25 pm    Post subject:
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: 8593
Location: Back in jolly old England

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

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

Site Director


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

PostPosted: Tue Nov 16, 2010 9:46 pm    Post subject:
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

Senior Member


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

PostPosted: Tue Nov 16, 2010 10:04 pm    Post subject:
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: 67
Location: 125.16.180.5

PostPosted: Wed Nov 17, 2010 11:13 pm    Post subject:
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: 67
Location: 125.16.180.5

PostPosted: Wed Nov 17, 2010 11:20 pm    Post subject:
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: 67
Location: 125.16.180.5

PostPosted: Wed Nov 17, 2010 11:42 pm    Post subject:
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

Site Director


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

PostPosted: Wed Nov 17, 2010 11:55 pm    Post subject: Reply to: If my input file is empty, copy a dummy record
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    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 syncsort: copy lines after the keyword shreya19 SYNCSORT 1 Fri Dec 02, 2016 9:47 am
No new posts High CPU consumption Job using IAM fi... aswinir JCL & VSAM 8 Thu Dec 01, 2016 8:28 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm


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