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

SYNCSORT - Reformat file to create a output file


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

New User


Joined: 30 Sep 2008
Posts: 17
Location: City

PostPosted: Fri Oct 03, 2008 4:56 pm
Reply with quote

Hi ,
I have an input file which looks as below:
can somebody help me in creating a file as output file specified.

Code:

12345   xyz1   f345433    h34544
        name1
        name2
        name3
        name4
24345   xyz3   h345454    h345444
        name5
467655  zyt3   5fbgfdgr    efer t
        name6
        name7
        name8


output file should be:

Code:

12345   xyz1   f345433    h34544
12345   name1
12345   name2
12345   name3
12345   name4
24345   xyz3   h345454    h345444
24345   name5
467655  zyt3   5fbgfdgr    efer t
467655  name6
467655  name7
467655  name8
467655  name8
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Fri Oct 03, 2008 10:23 pm
Reply with quote

You can use a DFSORT job like the following to do what you asked for. You'll need z/OS DFSORT V1R5 PTF UK90013 (July, 2008) to use the new WHEN=GROUP function. If you don't have this PTF, ask your System Programmer to install it (it's free).

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *
12345   xyz1   f345433    h34544
        name1
        name2
        name3
        name4
24345   xyz3   h345454    h345444
        name5
467655  zyt3   5fbgfdgr    efer t
        name6
        name7
        name8
/*
//SORTOUT DD SYSOUT=*
//SYSIN    DD    *
  OPTION COPY
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,8,CH,NE,C' '),
     PUSH=(1:1,8))
/*


For complete details on the WHEN=GROUP function and the other new functions available with PTF UK90013, see:

www.ibm.com/systems/support/s...sort/mvs/ugpf/
Back to top
View user's profile Send private message
swapnam

New User


Joined: 30 Sep 2008
Posts: 17
Location: City

PostPosted: Tue Oct 07, 2008 10:39 am
Reply with quote

Thanks Frank,

I couldnt visit as i was not in.
I will try this option.

Thanks alot
Back to top
View user's profile Send private message
swapnam

New User


Joined: 30 Sep 2008
Posts: 17
Location: City

PostPosted: Wed Oct 08, 2008 1:21 pm
Reply with quote

Hi,


I tried this option but itsg ivnig th below error msg when trying to execute.
ABENDED S000 U0016 CN(INTE
OPTION COPY
*
INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,8,CH,NE,C' '),
*
PUSH=(1:1,8))
WER275A NO KEYWORDS FOUND ON CONTROL STATEMENT
WER275A NO KEYWORDS FOUND ON CONTROL STATEMENT
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE

Can you please tell me what is the prob.is it that this particular option is not available in mainframe system.

Is there any other way of getting the required output file.Please help

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

Moderator


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

PostPosted: Wed Oct 08, 2008 1:25 pm
Reply with quote

Hello swapnam,

The WER messgaes indicate that you are using Syncsort and NOT DFSORT. Since you posted in DFSORT forum, Frank assumed you're using DFSORT and the solution given by him works ONLY with DFSORT and not with Syncsort.
Back to top
View user's profile Send private message
swapnam

New User


Joined: 30 Sep 2008
Posts: 17
Location: City

PostPosted: Wed Oct 08, 2008 1:27 pm
Reply with quote

Hi Arun,

How can we do this using syncsort.

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

Moderator


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

PostPosted: Wed Oct 08, 2008 2:00 pm
Reply with quote

Hello swapnam,

You can do this using the below SYNCTOOL job. This works for the sample data you posted. You can modify it as per your actual file attributes.

Code:
//STEP1   EXEC PGM=SYNCTOOL                                         
//TOOLMSG   DD SYSOUT=*                                             
//DFSMSG    DD SYSOUT=*                                             
//IN        DD DSN=...Input file  -----> (FB,LRECL=80)               
//OUT       DD DSN=...Output file -----> (FB,LRECL=80)               
//TOOLIN    DD *                                                     
  SPLICE FROM(IN) TO(OUT) ON(89,8,CH) WITH(9,64) WITHALL KEEPBASE - 
                                                    USING(CTL1)     
//CTL1CNTL  DD *                                                     
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,8,ZD)),                 
        IFTHEN=(WHEN=(1,8,CH,NE,C' '),OVERLAY=(89:SEQNUM,8,ZD)),     
        IFTHEN=(WHEN=NONE,                                           
        OVERLAY=(89:SEQNUM,8,ZD,89:81,8,ZD,SUB,89,8,ZD,M11,LENGTH=8))
  OUTFIL BUILD=(1,80)     

OUT
Code:
12345   xyz1   f345433    h34544
12345   name1                   
12345   name2                   
12345   name3                   
12345   name4                   
24345   xyz3   h345454    h345444
24345   name5                   
467655  zyt3   5fbgfdgr    efer t
467655  name6                   
467655  name7                   
467655  name8     
Back to top
View user's profile Send private message
swapnam

New User


Joined: 30 Sep 2008
Posts: 17
Location: City

PostPosted: Wed Oct 08, 2008 5:51 pm
Reply with quote

Hi Arun,

Thanks for the help
i have tried with my file and it worked.

thanks a lot
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 TRIM everything from input, output co... DFSORT/ICETOOL 1
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
Search our Forums:

Back to Top