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
 

 

Reformating the OUTPUT file

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

Active User


Joined: 02 Jul 2007
Posts: 109
Location: Chennai - India

PostPosted: Sun Dec 14, 2008 8:05 am    Post subject: Reformating the OUTPUT file
Reply with quote

Hi i have the below requirement

Input file :

ABCD 001 M001
ABCD 001 M002
ABCD 002 M001
ABCD 002 M002
EBCD 002 M001
EBCD 002 M003
CBCD 002 M002

My output file should be

Set1 Set2
001 M001
001 M002
002 M001
002 M002
002 M003

That is i want unique entries of variable 2 and variable 3 and reformat the output file only with that data with a header record.

Just by referring some threads here, i just wrote the below code.

SORT FIELDS(6,3,A,10,4,A)
SUM FILEDS=NONE
OUTREC FIELDS=(6,8,1X,1,8)
OUTFIL HEADER1=(1:C'SET-1',5:C'SET-2)

i just wrote this SORTCARD seeing other threads, not yet tested. i can able to test it on Tuesday only. Can anyone help whether my card works or not as per my requirement.
Back to top
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Sun Dec 14, 2008 8:59 am    Post subject:
Reply with quote

Hello,

Does your system use Syncsort or DFSORT?

Per your request, the other topic has been deleted.
Back to top
View user's profile Send private message
sasikumar1984

Active User


Joined: 02 Jul 2007
Posts: 109
Location: Chennai - India

PostPosted: Sun Dec 14, 2008 9:34 am    Post subject: thanks for ur reply..
Reply with quote

Hi Dick,

We use SYNCSORT...
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Sun Dec 14, 2008 9:59 am    Post subject:
Reply with quote

Hello,

You were close icon_smile.gif

This:
Code:
   SORT FIELDS(6,3,CH,A,10,4,CH,A)     
   SUM FIELDS=NONE                     
   OUTREC FIELDS=(1X,6,3,2X,10,4,5X)   
   OUTFIL HEADER1=(C'SET-1 SET-2')     

gives this:
Code:
SET-1 SET-2
 001  M001
 001  M002
 002  M001
 002  M002
 002  M003

using Syncsort.

For the SORTOUT, use
Code:
DCB=(RECFM=FBA,BLKSIZE=0,LRECL=16)
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Sun Dec 14, 2008 2:05 pm    Post subject:
Reply with quote

sasikumar1984,

Here's another way of achieving the same using SYNCTOOL(untested).
Code:
//STEP1  EXEC PGM=SYNCTOOL
//TOOLMSG  DD SYSOUT=*
//DFSMSG   DD SYSOUT-*
//IN       DD DSN= Input file
//OUT      DD DSN= Output file
//TOOLIN   DD *
  SELECT FROM(IN) TO(OUT) ON(6,8,CH) FIRST USING(CTL1)
//CTL1CNTL DD *
  OUTFIL REMOVECC,HEADER1=(C'Set1 Set2'),BUILD=(6,8)
Back to top
View user's profile Send private message
sasikumar1984

Active User


Joined: 02 Jul 2007
Posts: 109
Location: Chennai - India

PostPosted: Sun Dec 14, 2008 9:31 pm    Post subject: Thanks for ur reply...
Reply with quote

Arun,

Thanks for ur reply.. as per ur code, i need to have two components to pass the sortcard rite??? i have already one sortcard... i just wanted to change that component alone to achieve the requirement... thanks for ur reply.. i can learn lot seeing ur reply....
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Sun Dec 14, 2008 10:10 pm    Post subject:
Reply with quote

Hello,

Hopefully, you read Arun's post as well as the suggestion/solution before it. . .

From your reply it is not clear that you found it. . .

Are you now ready for Tuesday?
Back to top
View user's profile Send private message
sasikumar1984

Active User


Joined: 02 Jul 2007
Posts: 109
Location: Chennai - India

PostPosted: Sun Dec 14, 2008 11:51 pm    Post subject:
Reply with quote

Hi dick.....

i got solution for my requirement.... of course not yet tested... I just replied to Aruns msg saying, as per his code we need to components to pass the sortcard.. one for TOOLIN and another for CTL1CNTL. but i dont want tat... however i can see different way of achieving the o/p from his reply..

yes i am waiting for Tuesday....
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Mon Dec 15, 2008 1:14 am    Post subject:
Reply with quote

Hello,

Quote:
i got solution for my requirement.... of course not yet tested...
The result you said you needed has been tested - to repeat:

Quote:
This:
Code:
   SORT FIELDS(6,3,CH,A,10,4,CH,A)     
   SUM FIELDS=NONE                     
   OUTREC FIELDS=(1X,6,3,2X,10,4,5X)   
   OUTFIL HEADER1=(C'SET-1 SET-2')       

gives this:
Code:
SET-1 SET-2
 001  M001
 001  M002
 002  M001
 002  M002
 002  M003 


using Syncsort.

For the SORTOUT, use:
Code:
DCB=(RECFM=FBA,BLKSIZE=0,LRECL=16)
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Mon Dec 15, 2008 10:24 am    Post subject:
Reply with quote

Hi Dick,

I think he was trying to say that he's yet to run the job with his file. Of course it does n't matter as it's tested OK by you. icon_biggrin.gif
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Mon Dec 15, 2008 10:30 am    Post subject: Reply to: Reformating the OUTPUT file
Reply with quote

Hi Arun,

Quote:
I think he was trying to say that he's yet to run the job with his file.
Hopefully icon_smile.gif

What has happened several times in the past is that when multiply replies are posted, one or more seems to "hide" and is missed icon_wink.gif

Thanks for the followup,

d
Back to top
View user's profile Send private message
Yugaswaroopini

New User


Joined: 21 Dec 2007
Posts: 10
Location: India

PostPosted: Tue Dec 16, 2008 6:21 pm    Post subject: Reply to: Reformating the OUTPUT file
Reply with quote

Hi All,

Just want to know this.. if the file is opened in the browse mode, we have the following ..
********************************
SET-1 SET-2
001 M001
001 M002
002 M001
002 M002
002 M003
********************************

But if the file is opened in view mode, there is a page break (the 1) as follows

*****************************
1SET-1 SET-2
1 001 M001
001 M002
002 M001
002 M002
002 M003
****************************

My question : Is there a way to get an output file without the page break.? Cos when this file is done FTP, the '1' is also present. There is a requirement in my project to include the header and FTP the file which should not have a pagebreak.
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Tue Dec 16, 2008 8:22 pm    Post subject:
Reply with quote

Quote:
Is there a way to get an output file without the page break.?

Yes, Add the REMOVECC parameter to your OUTFIL statement like this.
Code:
OUTFIL REMOVECC,HEADER1=(C'SET-1 SET-2') 
Back to top
View user's profile Send private message
Yugaswaroopini

New User


Joined: 21 Dec 2007
Posts: 10
Location: India

PostPosted: Wed Dec 17, 2008 11:34 am    Post subject:
Reply with quote

Arun,

Thanks a ton javascript:emoticon('icon_smile.gif')
Smile

Thanks,
YS.
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 Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm


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