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
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Required 1st row of i/p into 2 rows in output
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: 2150
Location: At my coffee table

PostPosted: Thu May 06, 2010 8:48 pm    Post subject:
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 Moderator


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

PostPosted: Thu May 06, 2010 10:01 pm    Post subject:
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: 1703
Location: Australia

PostPosted: Wed May 12, 2010 6:18 am    Post subject:
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    Post subject: Reply to: Required 1st row of i/p into 2 rows in output
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts find RACF group for access to spooled... jzhardy JCL & VSAM 1 Mon May 08, 2017 11:46 am
No new posts Problem reading GTF trace output danik56 ABENDS & Debugging 7 Thu Mar 16, 2017 1:02 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts To display values of multiple rows in... vinu78 DB2 2 Thu Mar 09, 2017 1:20 pm
No new posts How to get current date -1 and curren... murali.andaluri DFSORT/ICETOOL 3 Wed Mar 08, 2017 2:09 pm


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