|
View previous topic :: View next topic
|
| Author |
Message |
lagneshp
New User
Joined: 15 Aug 2009 Posts: 29 Location: Chennai
|
|
|
|
Hi,
My Expected Outpt File looks like:
VOL MB3127,NODSN
REP EXPDT=2010/108
VOL KD9379,NODSN
REP EXPDT=2010/108
VOL KD9409,NODSN
REP EXPDT=2010/108
VOL C55746,NODSN
REP EXPDT=2010/108
VOL C56336,NODSN
REP EXPDT=2010/108
VOL ID9193,NODSN
My input file looks like
PIMA.CP000000.GLOB.OFF.HHSTEOM.G0039V00 NA5906 2037/016
PIMA.CP000000.GLOB.OFF.HHSTEOM.G0039V00 NA5950 2037/016
PIMA.CP000000.GLOB.OFF.HHSTEOM.G0040V00 MB3099 2037/046
PIMA.CP000000.GLOB.OFF.HHSTEOM.G0040V00 MB3127 2037/046
PIMA.CP000000.GLOB.OFF.HHSTEOM.G0041V00 KD9379 2037/078
PIMA.CP000000.GLOB.OFF.HHSTEOM.G0041V00 KD9409 2037/078
PIMA.CP000000.GLOB.OFF.HHSTEOM.G0042V00 C55746 2037/107
PIMA.CP000000.GLOB.OFF.HHSTEOM.G0042V00 C56336 2037/107
PIMA.CP000000.GLOB.OFF.HHSTEOM.G0043V00 ID9193 2037/138
i have to take last two columns of input file for the values of vol and expdt in output file.
i have a jcl where i got output as first row(vol row alone)
JCL:
//SYSIN DD *
SORT FIELDS=COPY
OUTREC FIELDS=(1:C'VOL ',5:51,6,11:C',NODSN',17:64X)
Output:
VOL ID7365,NODSN
VOL C20375,NODSN
VOL FD3046,NODSN
VOL KQ3925,NODSN
VOL JM5416,NODSN
Where i am looking for output like this:
VOL MB3127,NODSN
REP EXPDT=2010/108
VOL KD9379,NODSN
REP EXPDT=2010/108
VOL KD9409,NODSN
REP EXPDT=2010/108
VOL C55746,NODSN
REP EXPDT=2010/108
VOL C56336,NODSN
means i want some values from the first row of input file to be in the first row of output file and some other values from input file to be in second row of the output file.
i also tried with this sort card
//SYSIN DD *
SORT FIELDS=COPY
OUTREC FIELDS=(1:C'VOL ',5:51,6,11:C',NODSN',17:64X)
OUTREC FIELDS=(1:C'REP EXPDT=',11:60,8)
it got abended as it has two outrec fileds. Could some one provide sort card so that it can write first row of input files in to two rows in output file. |
|
| Back to top |
|
 |
CICS Guy
Senior Member

Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
| Have you noticed the use of '/' (slash) to cause additional output to be on the next line/record? |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
lagnsehp,
You can use a DFSORT job like the following to do what you asked for:
| Code: |
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
PIMA.CP000000.GLOB.OFF.HHSTEOM.G0039V00 NA5906 2037/016
PIMA.CP000000.GLOB.OFF.HHSTEOM.G0039V00 NA5950 2037/016
PIMA.CP000000.GLOB.OFF.HHSTEOM.G0040V00 MB3099 2037/046
PIMA.CP000000.GLOB.OFF.HHSTEOM.G0040V00 MB3127 2037/046
PIMA.CP000000.GLOB.OFF.HHSTEOM.G0041V00 KD9379 2037/078
PIMA.CP000000.GLOB.OFF.HHSTEOM.G0041V00 KD9409 2037/078
PIMA.CP000000.GLOB.OFF.HHSTEOM.G0042V00 C55746 2037/107
PIMA.CP000000.GLOB.OFF.HHSTEOM.G0042V00 C56336 2037/107
PIMA.CP000000.GLOB.OFF.HHSTEOM.G0043V00 ID9193 2037/138
/*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL BUILD=(1:C'VOL ',5:51,6,11:C',NODSN',17:64X,/,
1:C'REP EXPDT=',11:60,8)
/*
|
|
|
| Back to top |
|
 |
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi lagneshp,
I noticed some of your output does not match the data from the input file
ie. all of the output shows
2010/108 is nowhere to be seen on your input file, so how did you manage this ? are you trying to override the expiry date ?
Gerry |
|
| Back to top |
|
 |
lagneshp
New User
Joined: 15 Aug 2009 Posts: 29 Location: Chennai
|
|
|
|
Sorry for Delayed Response.
Hi gcicchet,
Yes, I am Over riding with new Expiry Date.
Hi CICS Guy and Frank Yaeger,
I Tried your code and got the output.
Thanks for your valuable reply.......................... |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|