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

Syncsort related


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
smita V

New User


Joined: 05 Nov 2007
Posts: 11
Location: hyderabad

PostPosted: Tue Mar 25, 2008 1:14 pm
Reply with quote

Hi!

Using Syncsort, from a flat file I hav to do modification on some selected records and has to write all the records(modified as well as untouched records) into output file.

Is it possible in a single step and how?
Back to top
View user's profile Send private message
ParagChouguley

Active User


Joined: 03 Feb 2007
Posts: 175
Location: PUNE(INDIA)

PostPosted: Tue Mar 25, 2008 1:38 pm
Reply with quote

Hi Smita V,
Quote:

Using Syncsort, from a flat file I hav to do modification on some selected records and has to write all the records(modified as well as untouched records) into output file.

Is it possible in a single step and how?


Yes, it is possible. Please give sample input file and sample output along with other info like LRECL and RECFM of file.

--Parag
Back to top
View user's profile Send private message
smita V

New User


Joined: 05 Nov 2007
Posts: 11
Location: hyderabad

PostPosted: Tue Mar 25, 2008 3:36 pm
Reply with quote

Hi Parag!

Input File:

1234abcdef
1235avbtef
1236
1237ujyrtbv
1238

Output file should be ==>

1234abcdef
1235avbtef
1236*****
1237ujyrtb
1238*****

I have to select records from input file which has spaces from 5th byte onwards and have to populate system date value on it.

I tried IFTHEN option but it is not working for me.

Note: We use version 1.2 not 1.3, is that a problem for IFTHEN not to work.

I want to get this done in single step that's why not spliting the file and then merging it.
Back to top
View user's profile Send private message
ParagChouguley

Active User


Joined: 03 Feb 2007
Posts: 175
Location: PUNE(INDIA)

PostPosted: Tue Mar 25, 2008 5:00 pm
Reply with quote

Hi Smita V,
Quote:

I tried IFTHEN option but it is not working for me.

Note: We use version 1.2 not 1.3, is that a problem for IFTHEN not to work.


Hmmm..... I too have no idea about this.
Probably some senior members or syncsort experts will be able to throw some light on this.

Anyway, here is a synctool job that works on my platform and does what you asked for.

Code:


//S1      EXEC PGM=SYNCTOOL                           
//TOOLMSG DD SYSOUT=*                                 
//DFSMSG  DD SYSOUT=*                                 
//IN1     DD *                                       
1234ABCDEF                                           
1235AVBTEF                                           
1236                                                 
1237UJYRTBV                                           
1238                                                 
/*                                                   
//OUT1    DD DSN=OUTPUT-FILE-NAME,                   
//      DSORG=PS,RECFM=FB,SPACE=(CYL,(10,10),RLSE),   
//      DISP=(NEW,CATLG,DELETE)                       
//TOOLIN  DD *                             
    COPY FROM(IN1) TO(OUT1) USING(SRT1)     
/*                                         
//SRT1CNTL DD *                             
    OPTION COPY                             
    OUTREC IFTHEN=(WHEN=(5,8,CH,EQ,C' '),   
            BUILD=(1,4,DATE1,13,68)),       
           IFTHEN=(WHEN=NONE,               
            BUILD=(1,80))                   
/*                                         


Output :
Code:

1234ABCDEF         
1235AVBTEF         
123620080325       
1237UJYRTBV         
123820080325       


--Parag
Back to top
View user's profile Send private message
sril.krishy

Active User


Joined: 30 Jul 2005
Posts: 183
Location: hyderabad

PostPosted: Tue Mar 25, 2008 6:35 pm
Reply with quote

Hi,
Please see the other solution without the IFTHEN.

Code:

//PS020    EXEC PGM=SYNCTOOL                                           
//SYSOUT   DD  SYSOUT=*                                               
//TOOLMSG  DD  SYSOUT=*                                               
//DFSMSG   DD  SYSOUT=*                                               
//IN       DD  *                                                     
1234ABCDEF                                                           
1235AVBTEF                                                           
1236                                                                 
1237UJYRTBV                                                           
1238                                                                 
//T1       DD DSN=&&T1,UNIT=SCRPK,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)   
//T2       DD DSN=&&T2,UNIT=SCRPK,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)   
//OUT2     DD SYSOUT=*                                               
//CON      DD  DSN=*.T1,VOL=REF=*.T1,DISP=SHR                         
//         DD  DSN=*.T2,VOL=REF=*.T2,DISP=SHR                         
//TOOLIN   DD  *                                                     
   COPY FROM(IN) USING(CTL1)                                         
   SORT FROM(CON) TO(OUT2) USING(CTL2)                               
//CTL1CNTL DD  *                                                     
   INREC FIELDS=(1,12,15:SEQNUM,8,ZD,80:X)                           
   OUTFIL FNAMES=T1,                                                 
   INCLUDE=(5,1,CH,EQ,C' '),                                         
   OUTREC=(1,4,DATE1,2X,15,8)                                         
   OUTFIL FNAMES=T2,                                                 
   INCLUDE=(5,1,CH,NE,C' '),                                         
   OUTREC=(1,12,2X,15,8)                                             
//CTL2CNTL DD  *                                                     
   SORT FIELDS=(15,8,CH,A)                                           
   OUTREC FIELDS=(1,14,80:X)                                         


Code:


output (OUT2 ):

1234ABCDEF   
1235AVBTEF   
123620080325
1237UJYRTBV 
123820080325



Thanks
Krishy
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 496
Location: USA

PostPosted: Tue Mar 25, 2008 11:39 pm
Reply with quote

smita V wrote:
I tried IFTHEN option but it is not working for me.

How is it "not working"? Are you getting a syntax error?

Support for IFTHEN was included in SyncSort for z/OS 1.2.1 and later.

If you are running SyncSort for z/OS 1.2.0, then this can still be accomplished in a single pass of the data without using IFTHEN. You can code an INREC statement to add a field at the end of the record which contains the current system date, and then use that field as the replacement value in OUTREC CHANGE.
Back to top
View user's profile Send private message
smita V

New User


Joined: 05 Nov 2007
Posts: 11
Location: hyderabad

PostPosted: Wed Mar 26, 2008 6:52 pm
Reply with quote

Hi Krishy,

Thanks, your logic worked perfectly for me...... icon_smile.gif


Hi Alissa,

Our syncsort version is 1.2.0, thats why I was getting Syntax error with IFTHEN..........


Thanks,
Smita
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 only first records of the fil... SYNCSORT 7
No new posts Count Records with a crietaria in a f... DFSORT/ICETOOL 5
No new posts DFSORT/SYNCSORT/ICETOOL JCL & VSAM 8
No new posts Syncsort "Y2C" Function SYNCSORT 1
No new posts Related to Unit Testing Testing & Performance 2
Search our Forums:

Back to Top