IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Required 1st row of i/p into 2 rows in output


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
lagneshp

New User


Joined: 15 Aug 2009
Posts: 29
Location: Chennai

PostPosted: Thu May 06, 2010 8:16 pm
Reply with quote

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
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Thu May 06, 2010 8:48 pm
Reply with quote

Have you noticed the use of '/' (slash) to cause additional output to be on the next line/record?
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu May 06, 2010 10:01 pm
Reply with quote

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
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Wed May 12, 2010 6:18 am
Reply with quote

Hi lagneshp,

I noticed some of your output does not match the data from the input file
ie. all of the output shows
Code:
REP EXPDT=2010/108


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
View user's profile Send private message
lagneshp

New User


Joined: 15 Aug 2009
Posts: 29
Location: Chennai

PostPosted: Mon Jun 28, 2010 7:18 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts TRIM everything from input, output co... DFSORT/ICETOOL 1
No new posts To get the count of rows for every 1 ... DB2 3
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts Exclude rows with > than x occurre... DFSORT/ICETOOL 6
No new posts Joinkeys - 5 output files DFSORT/ICETOOL 7
Search our Forums:

Back to Top