View previous topic :: View next topic
|
Author |
Message |
priyanka.msharma Warnings : 1 New User
Joined: 28 Jan 2009 Posts: 12 Location: India
|
|
|
|
I have a seq file that has header, detail and trailer record. Header contains date & time that i want to write in details record of o/p file
Input file:
H02162009052933001
D1234567890C11234567BOTHabc@gmail.com
D1234567890C11234567BOTHpqr@gmail.com
T0005602162009052933001
Desired Output file
D1234567890C11234567BOTHabc@gmail.com02162009
D1234567890C11234567BOTHpqr@gmail.com02162009 |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Please DO NOT post the same topic twice. |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Hello,
Welcome to the forums.
What is your input and output RECFM/LRECL?
At what position in the output you want to 'attach' the date extracted from header? |
|
Back to top |
|
|
priyanka.msharma Warnings : 1 New User
Joined: 28 Jan 2009 Posts: 12 Location: India
|
|
|
|
Input RECFM is FB and LRECL is 88
Output RECFM is FB and LRECL is 150
I want to write date and time (from header) from 90th Position.
-------------------------------------------------------------------------------
Expat,
I apologize for writing the same Q again coz this was my first post and I was not aware ppl wud take it as an offense.
I wud have appriciated if u cud have answered or atleast tried to answer my Q rather than giving ur mind in telling me that Q is repeated.
Its a mistake...n humans can/may/will do mistakes at some point of life.
Thanks anyways. Bye |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
Quote: |
I apologize for writing the same Q again coz this was my first post and I was not aware ppl wud take it as an offense.
I wud have appriciated if u cud have answered or atleast tried to answer my Q rather than giving ur mind in telling me that Q is repeated.
Its a mistake...n humans can/may/will do mistakes at some point of life. |
but they will find hard to read Your posts if You keep up with a script kiddie language
as an alternative have Your keyboard fixed |
|
Back to top |
|
|
priyanka.msharma Warnings : 1 New User
Joined: 28 Jan 2009 Posts: 12 Location: India
|
|
|
|
Thanks for ur valuable comments.
post edited to take away unpolite remarks (e.s.) |
|
Back to top |
|
|
Alissa Margulies
SYNCSORT Support
Joined: 25 Jul 2007 Posts: 496 Location: USA
|
|
|
|
If you want the HEADER and TRAILER records included in the output, then here is one way of achieving your desired output using SyncSort for z/OS 1.3.2:
Code: |
//SORT1 EXEC PGM=SORT
//SORTIN DD *
H02162009052933001
D1234567890C11234567BOTHABC@GMAIL.COM
D1234567890C11234567BOTHPQR@GMAIL.COM
T0005602162009052933001
//SORTOUT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTREC IFTHEN=(WHEN=GROUP,BEGIN=(1,1,CH,EQ,C'H'),
PUSH=(38:2,8)),
IFTHEN=(WHEN=(1,1,CH,EQ,L(C'H',C'T')),
OVERLAY=(38:8X))
/* |
However, if you only want the DETAIL records, then try this instead:
Code: |
//SYSIN DD *
INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,1,CH,EQ,C'H'),
PUSH=(38:2,8))
SORT FIELDS=COPY
OUTFIL OUTREC=(1,80),INCLUDE=(1,1,CH,NE,L(C'H',C'T'))
/* |
You will obviously need to modify the positions and field lengths to match your actual data. |
|
Back to top |
|
|
priyanka.msharma Warnings : 1 New User
Joined: 28 Jan 2009 Posts: 12 Location: India
|
|
|
|
Hi Alissa,
Thankyou for providing solution to my problem. Unfortunately my application supports SyncSort for z/OS 1.3.0.1 and so it does not identifies keywords like GROUP, PUSH etc.
One of my friend tried doing this with JOINKEYS but unfortunately his version was SyncSort for z/OS 1.3.1.0
It wud be really helpful if you could provide solution on version SyncSort for z/OS 1.3.0.1
Thanks again |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
You can achieve the same by creating a symbol for date/time in step1 and then use the same in your step2.
But what is the length of your date-time field? As per your previous posts, you need to insert the date-time field at 90th pos. Do you want to fill the rest of the positions till 155 with spaces? |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Hello,
The SYMNAMES approach works with SyncSort for z/OS 1.2.1.0(my version).
Code: |
//STEP1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN= Input file
//SORTOUT DD DSN=&&S1,DISP=(,PASS)
//SORTOUT DD SYSOUT=*
//SYSIN DD *
INCLUDE COND=(1,1,CH,EQ,C'H')
INREC BUILD=(C'DATE-X,''',2,14,C'''',80:X)
SORT FIELDS=COPY
//STEP2 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN= Input file
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)
//SORTOUT DD DSN= Output file ---> FB/LRECL=155
//SYSIN DD *
OMIT COND=(1,1,SS,EQ,C'H,T')
INREC OVERLAY=(90:DATE-X,155:X)
SORT FIELDS=COPY |
|
|
Back to top |
|
|
|