MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Add a Dummy record using Syncsort

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
mahesh_chv
Beginner


Joined: 04 Aug 2005
Posts: 41
Topics: 16

PostPosted: Thu Dec 09, 2010 6:40 am    Post subject: Add a Dummy record using Syncsort Reply with quote

Hi,

I need to add a trailer to my output file which acts as a dummy record in case if my input file is empty.
The trailer contains two fields
1. X(22) -- should contain all 9's
2. S9(11)V9(2) Comp-3 which is an amount field with 2 decimal positions.( this field should contain zeros )


Can you please suggest me Syncsort JCL to achieve this.
Back to top
View user's profile Send private message
computer
Beginner


Joined: 12 Jun 2007
Posts: 64
Topics: 17
Location: Hyderabad

PostPosted: Thu Dec 09, 2010 2:33 pm    Post subject: Reply with quote

Hi Mahesh,

I would like to suggest a solution in IDCAMS. Infact I have implemented this in one of my project....
Code:

//STEP0001 DD DSN=IDCAMS
//INPUT      DD DSN=YOUR.INPUT.FILE,DISP=SHR
//DMYDATA DD DSN=YOUR.DUMMY.DATA.FILE,DISP=SHR
//TEMPFILE  DD DSN=&&TEMP,DISP=(PASS,DELETE,DELETE)
//OUTPUT    DD DSN=YOUR.OUTPUT.FILE,
//                     DISP=(NEW,CATLG,DELETE)
...
//SYSIN       DD *
  REPRO  INFILE(INPUT) OUTFILE(TEMPFILE) COUNT(1)
  IF LASTCC = 0 THEN REPRO INFILE(INPUT) OUTFILE(OUTPUT)
                         ELSE REPRO INFILE(DMYFILE) OUTFILE(OUTPUT)
/*


Hope this helps...

Thanks,
Computer
Back to top
View user's profile Send private message
mahesh_chv
Beginner


Joined: 04 Aug 2005
Posts: 41
Topics: 16

PostPosted: Thu Dec 09, 2010 9:25 pm    Post subject: Reply with quote

Thanks Computer,

But I need a solution using sync sort
Back to top
View user's profile Send private message
mahesh_chv
Beginner


Joined: 04 Aug 2005
Posts: 41
Topics: 16

PostPosted: Fri Dec 10, 2010 2:03 am    Post subject: Reply with quote

Cant we achieve this using Trailer ???
Can some one throw light on this?
Back to top
View user's profile Send private message
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Fri Dec 10, 2010 2:19 pm    Post subject: Reply with quote

Why must you have a Syncsort solution?

Have you tried using TRAILER. Learn by experimenting.
_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
Back to top
View user's profile Send private message
mahesh_chv
Beginner


Joined: 04 Aug 2005
Posts: 41
Topics: 16

PostPosted: Sun Dec 12, 2010 5:53 am    Post subject: Reply with quote

Nic Clouston,

I tried and experimented but couldnt achieve this.

Thanks,
Mahesh
Back to top
View user's profile Send private message
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Sun Dec 12, 2010 1:54 pm    Post subject: Reply with quote

You could create your record in a dataset then use IEBGENER, DFSORT (COPY option), or some other copy utility to create the dummy record in the designated file. You only have to create the dummy once then run the copy as and when required.
_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
Back to top
View user's profile Send private message
papadi
Supermod


Joined: 20 Oct 2009
Posts: 594
Topics: 1

PostPosted: Sun Dec 12, 2010 4:11 pm    Post subject: Reply with quote

Quote:

I tried and experimented but couldnt achieve this.
Post the jcl and control statements you tried and explain what went wrong (syntax error, abend, not the desired results, etc).

When posting the diagnostic info, post complete messages along with the message id(s).
_________________
All the best,

di
Back to top
View user's profile Send private message
mf_user
Intermediate


Joined: 01 Jun 2003
Posts: 372
Topics: 105

PostPosted: Fri Dec 17, 2010 7:03 am    Post subject: Reply with quote

Computer, should it be DMYDATA instead of DMYFILE in ELSE part of REPRO?

Thanks.
_________________
MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
==
Back to top
View user's profile Send private message Send e-mail
computer
Beginner


Joined: 12 Jun 2007
Posts: 64
Topics: 17
Location: Hyderabad

PostPosted: Fri Dec 17, 2010 11:09 am    Post subject: Reply with quote

mf_user,

Oops..its DMYDATA.

Thanks for correcting.
Computer
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group