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
 

 

How to change the column position dynamically in SYNCTOOL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
rajatbagga

Active User


Joined: 11 Mar 2007
Posts: 188
Location: india

PostPosted: Thu Jan 10, 2008 8:54 pm    Post subject: How to change the column position dynamically in SYNCTOOL
Reply with quote

In my JOB I have two input files and a output file for example:

INPUT FILE 1

Code:

pl1  Chandrashekar Sundaram
pl2  Kannan velusamy
pm1  Vijayabharathi Venkatesan
ao1  Vijayabhushan Devapooja


INPUT FILE 2

Code:

pl1   GM-VIP
pl1   PROJECT LEAD
pm1   GM
pm1   PROJECT MANAGER
ao1   GM-VIP
ao1   APPLICATION OWNER
ao1   CLIENT : GM


OUTPUT FILE

Code:

A45  Chandrashekar Sundaram     GM-VIP     PROJECT LEAD
A78  Vijayabharathi Venkatesan  GM         PROJECT MANAGER
A56  Vijayabhushan Devapooja    GM-VIP     APPLICATION OWNER  CLIENT : GM



I am using the following JOB for creating this OUTPUT FILE:

Code:

//S1    EXEC  PGM=SYNCTOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//CON     DD *
pl1  Chandrashekar Sundaram
pl2  Kannan velusamy
pm1  Vijayabharathi Venkatesan
ao1  Vijayabhushan Devapooja
/*
//       DD *
pl1   GM-VIP
pl1   PROJECT LEAD
pm1   GM
pm1   PROJECT MANAGER
ao1   GM-VIP
ao1   APPLICATION OWNER
ao1   CLIENT : GM

/*
//T1     DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//T2     DD DSN=&&T2,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//OUT    DD DSN=MZK10Q.TEST.FILE2,
//          DISP=(,CATLG,CATLG),
//          UNIT=TEMP,
//          SPACE=(TRK,(3))
//TOOLIN DD *
   SORT FROM(CON) TO(T1) USING(CTL1)
   SPLICE FROM(T1) TO(T2) ON(1,3,CH) -
   WITHEACH WITH(35,20) WITH(55,20) WITH(75,20)
   SORT FROM(T2) TO(OUT) USING(CTL2)
/*
//CTL1CNTL DD *
  OPTION EQUALS
  INREC OVERLAY=(509:SEQNUM,8,ZD)
  SORT FIELDS=(1,3,CH,A)
  OUTREC IFTHEN=(WHEN=INIT,
      OVERLAY=(501:SEQNUM,8,ZD,RESTART=(1,3))),
    IFTHEN=(WHEN=(501,8,ZD,EQ,+2),BUILD=(1,3,35:7,20,501:501,16)),
    IFTHEN=(WHEN=(501,8,ZD,EQ,+3),BUILD=(1,3,55:7,20,501:501,16)),
    IFTHEN=(WHEN=(501,8,ZD,EQ,+4),BUILD=(1,3,75:7,20,501:501,16))
/*
//CTL2CNTL DD *
      SORT FIELDS=(509,8,ZD,A)
/*


Now my problem here is that the Key values in the INPUT FILE 2 for example 'ao1' can repeat N number of times.For example if i add a record
"ao1 SHIFT : MORNING" in INPUT FILE 2 then the existing JOB will not be able to append 'SHIFT : MORNING' to 'ao1' key record in the OUTPUT FILE.
Everytime I have to add a condition like this
IFTHEN=(WHEN=(501,8,ZD,EQ,+5),BUILD=(1,3,95:7,20,501:501,16))
to handle this situation.

How can i avoid this? Can I change the column position and increment counter (bolded above) dynamically to avoid it? Or is there any other way.....please suggest
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 Jan 10, 2008 10:19 pm    Post subject:
Reply with quote

If you wanted to make it more automatic, you could have the job determine the maximum number of repetitions automatically and generate the corresponding WITH operands and IFTHEN clauses accordingly. But it would probably be easier to just code the WITH operands and IFTHEN clauses for the maximum number of repetitions you'd expect (e.g. 10).
Back to top
View user's profile Send private message
rajatbagga

Active User


Joined: 11 Mar 2007
Posts: 188
Location: india

PostPosted: Thu Jan 10, 2008 10:48 pm    Post subject:
Reply with quote

Frank Yaeger wrote:
If you wanted to make it more automatic, you could have the job determine the maximum number of repetitions automatically and generate the corresponding WITH operands and IFTHEN clauses accordingly.


Can you please explain the above mentioned quote by you with the help of some JOB code.....
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: Fri Jan 11, 2008 3:28 am    Post subject:
Reply with quote

I don't know where the 'A45' etc in your output file comes from, but going with the DFSORT/ICETOOL job you show, here's how you could modify it to generate and use the correct number of WITH and IFTHEN clauses. If you want to see what I'm "generating", use DFSORT copy to display &&CTL2CNTL, &&WITH and &&IF.

Code:

//S0    EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN2 DD DSN=...  input file2
//CTL2CNTL DD DSN=&&C1,UNIT=SYSDA,SPACE=(TRK,(5,5)),DISP=(,PASS)
//ONE DD *
ONE RECORD
/*
//WITH DD DSN=&&WITH,UNIT=SYSDA,SPACE=(TRK,(5,5)),DISP=(,PASS)
//IF DD DSN=&&IF,UNIT=SYSDA,SPACE=(TRK,(5,5)),DISP=(,PASS)
//TOOLIN DD *
COPY FROM(IN2) USING(CTL1)
COPY FROM(ONE) USING(CTL2)
/*
//CTL1CNTL DD    *
  INREC BUILD=(1,3,4:C'01')
  SORT FIELDS=(1,3,CH,A)
  OPTION ZDPRINT
  SUM FIELDS=(4,2,ZD)
 OUTFIL FNAMES=CTL2CNTL,REMOVECC,NODETAIL,BUILD=(80X),
  TRAILER1=(' OPTION COPY ',/,
   ' OUTFIL FNAMES=WITH,REPEAT=',
   MAX=(4,2,ZD,TO=ZD,LENGTH=2),',',/,
   '  BUILD=(C''  WITH(''',
   ',SEQNUM,4,ZD,START=35,INCR=20,C'',20)-'',80:X)',/,
   ' OUTFIL FNAMES=IF,REPEAT=',
     MAX=(4,2,ZD,TO=ZD,LENGTH=2),',',/,
   '  BUILD=(C''  IFTHEN=(WHEN=(501,8,ZD,EQ,''',
   ',SEQNUM,2,ZD,START=2,',/,
   '  C''),BUILD=(1,3,'',SEQNUM,4,ZD,START=35,INCR=20,',/,
   '  C'':7,20,501:501,16)),'',80:X)')
/*
//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//CON     DD DSN=...  input file1
//        DD DSN=...  input file2
//T1     DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//T2     DD DSN=&&T2,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//OUT    DD DSN=...   output file
//TOOLIN DD *
SORT FROM(CON) TO(T1) USING(CTL1)
SPLICE FROM(T1) TO(T2) ON(1,3,CH) -
/*
//       DD DSN=&&WITH,DISP=(OLD,PASS)
//       DD *
   WITHEACH
SORT FROM(T2) TO(OUT) USING(CTL2)
/*
//CTL1CNTL DD *
  OPTION EQUALS
  INREC OVERLAY=(509:SEQNUM,8,ZD)
  SORT FIELDS=(1,3,CH,A)
  OUTREC IFTHEN=(WHEN=INIT,
      OVERLAY=(501:SEQNUM,8,ZD,RESTART=(1,3))),
/*
//       DD DSN=&&IF,DISP=(OLD,PASS)
//       DD *
  IFOUTLEN=516
/*
//CTL2CNTL DD *
  SORT FIELDS=(509,8,ZD,A)
/*
Back to top
View user's profile Send private message
rajatbagga

Active User


Joined: 11 Mar 2007
Posts: 188
Location: india

PostPosted: Fri Jan 11, 2008 6:05 pm    Post subject:
Reply with quote

oh i am sorry actually the OUTPUT FILE is

Code:
pl1    Chandrashekar Sundaram     GM-VIP     PROJECT LEAD
pm1  Vijayabharathi Venkatesan  GM         PROJECT MANAGER
ao1   Vijayabhushan Devapooja    GM-VIP     APPLICATION OWNER  CLIENT : GM
Back to top
View user's profile Send private message
rajatbagga

Active User


Joined: 11 Mar 2007
Posts: 188
Location: india

PostPosted: Fri Jan 11, 2008 6:27 pm    Post subject:
Reply with quote

Hi Frank i tried the above code you posted but it is abending with the following message:

Code:
ABENDED S000 U0016


In Spool I found:

Code:
WER271A  OUTFIL STATEMENT  : NUMERIC FIELD ERROR
WER271A  OUTFIL STATEMENT  : NUMERIC FIELD ERROR


I am not able to rectify that please see what is the problem and rectify it
Back to top
View user's profile Send private message
rajatbagga

Active User


Joined: 11 Mar 2007
Posts: 188
Location: india

PostPosted: Fri Jan 11, 2008 6:47 pm    Post subject:
Reply with quote

I think this info from spool can help:

Code:

CTL2CNTL :
 OPTION COPY
 OUTFIL FNAMES=WITH,REPEAT=01,
                           *
  BUILD=(C'  WITH(',SEQNUM,4,ZD,START=35,INCR=20,C',20)-',80:X)
 OUTFIL FNAMES=IF,REPEAT=01,
                         *
  BUILD=(C'  IFTHEN=(WHEN=(501,8,ZD,EQ,',SEQNUM,2,ZD,START=2,
  C'),BUILD=(1,3,',SEQNUM,4,ZD,START=35,INCR=20,
  C':7,20,501:501,16)),',80:X)
WER428I  CALLER-PROVIDED IDENTIFIER IS "0002"
WER903I  SYNCSORT 1.2.1.0 IS NOT LICENSED FOR SERIAL 6FE80, TYPE 2096 X03,
WER903I  SYNCSORT WILL STOP WORKING IN  39 DAYS UNLESS A VALID KEY IS INSTA
WER271A  OUTFIL STATEMENT  : NUMERIC FIELD ERROR
WER271A  OUTFIL STATEMENT  : NUMERIC FIELD ERROR
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: Fri Jan 11, 2008 9:50 pm    Post subject:
Reply with quote

rajatbagga,

My job works fine with DFSORT. However, the WER messages indicate you're using Syncsort, not DFSORT.

I'm a DFSORT developer. DFSORT and Syncsort are competitive products. I'm happy to answer questions on DFSORT and DFSORT's ICETOOL, but I don't answer questions on Syncsort.
Back to top
View user's profile Send private message
rajatbagga

Active User


Joined: 11 Mar 2007
Posts: 188
Location: india

PostPosted: Fri Jan 11, 2008 10:01 pm    Post subject:
Reply with quote

No problem Frank... You have already helped me a lot by giving your wonderfull idea for solving this problem, I will try to use this code with DFSORT... Thank you very much again
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Fail to change physical VSAM filename... jacobdng CICS 7 Fri Jan 20, 2017 12:36 pm
This topic is locked: you cannot edit posts or make replies. DB2 query Using Recursion, Converting... smilewithashu2 DB2 3 Tue Jan 03, 2017 12:50 pm
No new posts SQZ pipe delimited file with 1 column... Rick Silvers DFSORT/ICETOOL 6 Sun Nov 06, 2016 8:11 pm
This topic is locked: you cannot edit posts or make replies. Checking wether a string starts from ... sundaram.naveen CLIST & REXX 9 Thu Oct 06, 2016 11:56 am
No new posts Change date (DD/MM/YY) in 2nd record ... uday kiran DFSORT/ICETOOL 12 Wed Sep 07, 2016 10:57 pm


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