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

Reformating the OUTPUT file


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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

Moderator Emeritus


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

PostPosted: Sun Dec 14, 2008 8:59 am
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
Reply with quote

Hi Dick,

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

Moderator Emeritus


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

PostPosted: Sun Dec 14, 2008 9:59 am
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: 2481
Location: @my desk

PostPosted: Sun Dec 14, 2008 2:05 pm
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
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

Moderator Emeritus


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

PostPosted: Sun Dec 14, 2008 10:10 pm
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
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

Moderator Emeritus


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

PostPosted: Mon Dec 15, 2008 1:14 am
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: 2481
Location: @my desk

PostPosted: Mon Dec 15, 2008 10:24 am
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

Moderator Emeritus


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

PostPosted: Mon Dec 15, 2008 10:30 am
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
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: 2481
Location: @my desk

PostPosted: Tue Dec 16, 2008 8:22 pm
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Unable to interpret a hex value to De... COBOL Programming 4
No new posts REXX/CMS How to place command console... CLIST & REXX 4
No new posts Reroute print output via REXX/SDSF TSO/ISPF 6
No new posts Concatenate 2 input datasets and give... JCL & VSAM 2
No new posts how to eliminate null indicator value... DB2 7
Search our Forums:

Back to Top