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 - Reformat file to create a output file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: SYNCSORT - Reformat file to create a output file
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 Moderator


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

PostPosted: Fri Oct 03, 2008 10:23 pm    Post subject:
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:

http://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    Post subject: Reply to: Reformat file to create a output file
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    Post subject: Reply to: Reformat file to create a output file
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: 2284
Location: @my desk

PostPosted: Wed Oct 08, 2008 1:25 pm    Post subject:
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    Post subject: Reply to: Reformat file to create a output file
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: 2284
Location: @my desk

PostPosted: Wed Oct 08, 2008 2:00 pm    Post subject:
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    Post subject: Reply to: SYNCSORT - Reformat file to create a output file
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    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