View previous topic :: View next topic |
Author |
Message |
mahesh_chv Beginner
Joined: 04 Aug 2005 Posts: 41 Topics: 16
|
Posted: Thu Dec 09, 2010 6:40 am Post subject: Add a Dummy record using Syncsort |
|
|
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 |
|
 |
computer Beginner
Joined: 12 Jun 2007 Posts: 64 Topics: 17 Location: Hyderabad
|
Posted: Thu Dec 09, 2010 2:33 pm Post subject: |
|
|
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 |
|
 |
mahesh_chv Beginner
Joined: 04 Aug 2005 Posts: 41 Topics: 16
|
Posted: Thu Dec 09, 2010 9:25 pm Post subject: |
|
|
Thanks Computer,
But I need a solution using sync sort |
|
Back to top |
|
 |
mahesh_chv Beginner
Joined: 04 Aug 2005 Posts: 41 Topics: 16
|
Posted: Fri Dec 10, 2010 2:03 am Post subject: |
|
|
Cant we achieve this using Trailer ???
Can some one throw light on this? |
|
Back to top |
|
 |
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Fri Dec 10, 2010 2:19 pm Post subject: |
|
|
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 |
|
 |
mahesh_chv Beginner
Joined: 04 Aug 2005 Posts: 41 Topics: 16
|
Posted: Sun Dec 12, 2010 5:53 am Post subject: |
|
|
Nic Clouston,
I tried and experimented but couldnt achieve this.
Thanks,
Mahesh |
|
Back to top |
|
 |
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Sun Dec 12, 2010 1:54 pm Post subject: |
|
|
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 |
|
 |
papadi Supermod
Joined: 20 Oct 2009 Posts: 594 Topics: 1
|
Posted: Sun Dec 12, 2010 4:11 pm Post subject: |
|
|
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 |
|
 |
mf_user Intermediate

Joined: 01 Jun 2003 Posts: 372 Topics: 105
|
Posted: Fri Dec 17, 2010 7:03 am Post subject: |
|
|
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 |
|
 |
computer Beginner
Joined: 12 Jun 2007 Posts: 64 Topics: 17 Location: Hyderabad
|
Posted: Fri Dec 17, 2010 11:09 am Post subject: |
|
|
mf_user,
Oops..its DMYDATA.
Thanks for correcting.
Computer |
|
Back to top |
|
 |
|
|