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

SYNCSORT date and time in detail records


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
priyanka.msharma
Warnings : 1

New User


Joined: 28 Jan 2009
Posts: 12
Location: India

PostPosted: Thu Feb 19, 2009 1:51 pm
Reply with quote

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

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu Feb 19, 2009 1:54 pm
Reply with quote

Please DO NOT post the same topic twice.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Thu Feb 19, 2009 1:58 pm
Reply with quote

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
View user's profile Send private message
priyanka.msharma
Warnings : 1

New User


Joined: 28 Jan 2009
Posts: 12
Location: India

PostPosted: Thu Feb 19, 2009 3:10 pm
Reply with quote

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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Feb 19, 2009 4:18 pm
Reply with quote

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 icon_smile.gif
Back to top
View user's profile Send private message
priyanka.msharma
Warnings : 1

New User


Joined: 28 Jan 2009
Posts: 12
Location: India

PostPosted: Thu Feb 19, 2009 4:27 pm
Reply with quote

Thanks for ur valuable comments.

post edited to take away unpolite remarks (e.s.)
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 496
Location: USA

PostPosted: Fri Feb 20, 2009 2:14 am
Reply with quote

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
View user's profile Send private message
priyanka.msharma
Warnings : 1

New User


Joined: 28 Jan 2009
Posts: 12
Location: India

PostPosted: Fri Feb 20, 2009 4:43 pm
Reply with quote

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 icon_smile.gif
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Fri Feb 20, 2009 5:33 pm
Reply with quote

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

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Fri Feb 20, 2009 5:48 pm
Reply with quote

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
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Compare only first records of the fil... SYNCSORT 7
Search our Forums:

Back to Top