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
 

 

SYNCSORT to format the input file

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

New User


Joined: 06 May 2006
Posts: 3
Location: Chennai

PostPosted: Tue Mar 03, 2009 12:27 am    Post subject: SYNCSORT to format the input file
Reply with quote

I need to format the input file as below.

Below is the manual process:

1. 'C on blank line ‘ ‘, (10 spaces between quotes)
2. ‘oo’ on first line to copy quotes and comma
3. 'oo’ on last line to copy quotes and comma
4. TF80 - to move a single set of SE’s pre-line to FIVE line-across
5. Edit with "(" in the first input and number and ") with ur" in the
last line

Code:
 

Input file
9500010913
9500015516
9500018049
9500018452
9500018460
9500010914
9500015515
9500018046
9500018457
9500018468

Need output as:

('9500010913', '9500015516', '9500018049', '9500018452', '9500018460',
'9500010914', '9500015515', '9500018046', '9500018457') WITH UR;     
 


This formated output will be used as an input to the SQL query coming in the next step.

Raj
Back to top
View user's profile Send private message

Sachinrethin

New User


Joined: 12 Oct 2007
Posts: 21
Location: Chennai

PostPosted: Tue Mar 03, 2009 10:10 am    Post subject: Re:SYNCSORT to format the input file
Reply with quote

Hi,

Try this code , i hope it helps!

INREC BUILD=(1:C'''',2:1,10,12:C''',',67X,81:SEQNUM,8,ZD)
SORT FIELDS=(81,8,CH,D)
OUTREC IFTHEN=(WHEN=(88,1,ZD,EQ,1),BUILD=(1,12,13:C' ',67X)),
IFTHEN=(WHEN=NONE,BUILD=(1,80))
OUTFIL REMOVECC,HEADER1=(1:'('),
TRAILER1=(') WITH UR;')
Back to top
View user's profile Send private message
Sachinrethin

New User


Joined: 12 Oct 2007
Posts: 21
Location: Chennai

PostPosted: Tue Mar 03, 2009 10:11 am    Post subject: Re:SYNCSORT to format the input file
Reply with quote

Hi ,


the output of the above sort card is,

(
'9500018468',
'9500018457',
'9500018046',
'9500015515',
'9500010914',
'9500018460',
'9500018452',
'9500018049',
'9500015516',
'9500010913'
) WITH UR;
Back to top
View user's profile Send private message
rajasekarme

New User


Joined: 06 May 2006
Posts: 3
Location: Chennai

PostPosted: Tue Mar 03, 2009 12:24 pm    Post subject: Reply to: SYNCSORT to format the input file
Reply with quote

Thanks Sachin, the above code helps me. Since I am supplying huge input numbers I prefer the TF80 format, (i.e) five input numbers a row. Like the one I displayed as expected output.

Thanks
Raj
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Tue Mar 03, 2009 2:41 pm    Post subject:
Reply with quote

rajasekarme,

This is one way of achieving it. Note that I have used two dummy values for the first and last values. Make sure there are no such values existing in the table. Good luck icon_smile.gif
Code:
//STEP1    EXEC PGM=SYNCTOOL                                         
//TOOLMSG  DD SYSOUT=*                                               
//DFSMSG   DD SYSOUT=*                                               
//IN       DD DSN= Input  file                                       
//OUT      DD DSN= Output file                                       
//TOOLIN   DD *                                                       
 SPLICE FROM(IN) TO(OUT) ON(97,8,CH) WITHEACH KEEPNODUPS -           
 WITH(25,13) WITH(38,13) WITH(51,13) WITH(64,13) USING(CTL1)         
//CTL1CNTL DD *                                                       
 INREC IFTHEN=(WHEN=INIT,                                             
       OVERLAY=(81:SEQNUM,8,ZD,89:81,8,ZD,MOD,+5,M11,LENGTH=8)),     
 IFTHEN=(WHEN=(89,8,ZD,EQ,1),OVERLAY=(12:C'''',1,10,C''','),HIT=NEXT),
 IFTHEN=(WHEN=(89,8,ZD,EQ,2),OVERLAY=(25:C'''',1,10,C''','),HIT=NEXT),
 IFTHEN=(WHEN=(89,8,ZD,EQ,3),OVERLAY=(38:C'''',1,10,C''','),HIT=NEXT),
 IFTHEN=(WHEN=(89,8,ZD,EQ,4),OVERLAY=(51:C'''',1,10,C''','),HIT=NEXT),
 IFTHEN=(WHEN=(89,8,ZD,EQ,0),OVERLAY=(64:C'''',1,10,C''',',           
                                      89:C'00000005'),HIT=NEXT),     
 IFTHEN=(WHEN=ANY,OVERLAY=(97:81,8,ZD,SUB,89,8,ZD,M11,LENGTH=8))     
 OUTFIL BUILD=(12,65,80:X),REMOVECC,                                 
        HEADER1=('(''FFFFFFFFFF'','),                                 
        TRAILER1=('''LLLLLLLLLL'')')
Back to top
View user's profile Send private message
rajasekarme

New User


Joined: 06 May 2006
Posts: 3
Location: Chennai

PostPosted: Wed Mar 04, 2009 12:09 am    Post subject: Reply to: SYNCSORT to format the input file
Reply with quote

Hi Arcvns,

Thanks a lot, the code you have suggested is working fine with my requirement. Those dummy header/trailer numbers will never be in our table, hence no problem in using them. Thanks again icon_biggrin.gif

Raj
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Wed Mar 04, 2009 12:16 am    Post subject:
Reply with quote

rajasekarme,

You're welcome. Good to hear it's working for you icon_smile.gif
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
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts How to generate a new unique Input fi... for1ranjith CLIST & REXX 11 Sat Jul 01, 2017 12:09 pm
No new posts Writing a file using online program grvtomar PL/I & Assembler 3 Fri Jun 30, 2017 1:06 pm


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