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

How to sort a file, having header and trailer in SYNCSORT


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

New User


Joined: 11 Oct 2005
Posts: 22

PostPosted: Thu Sep 18, 2008 10:49 am
Reply with quote

HI,

The input file is having header and trailer and we need to sort it by using a single JCL step. The output file should contain the header and trailer records. How can we do it in SYNCSORT or FILEAID batch?

No ICETOOL please......
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Thu Sep 18, 2008 10:57 am
Reply with quote

Hi,

I'm not aware of any sort capabilty in FILEAID.

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

Moderator


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

PostPosted: Thu Sep 18, 2008 11:00 am
Reply with quote

ESSPRABHU,
Quote:
How can we do it in SYNCSORT or FILEAID batch?
Difficult to answer with the inputs you have provided.
Please post some sample records, input/output file attributes and record identifiers(e.g., HEADER in pos 1 to 6 for header record)

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

New User


Joined: 11 Oct 2005
Posts: 22

PostPosted: Thu Sep 18, 2008 11:12 am
Reply with quote

Hi,

Input and outfiles will be FB only.
Take any LRECL for the files, I need just the example coding.

Input file:

header1
1235242
7665575
466757
5465757
Trailer1

Output file should be

Header1
1235242
466757
5465757
7665575
Trailer1
Back to top
View user's profile Send private message
ESSPRABHU

New User


Joined: 11 Oct 2005
Posts: 22

PostPosted: Thu Sep 18, 2008 11:14 am
Reply with quote

We are using SYNCSORT, that's please provide the solution in SYNCSORT.
Back to top
View user's profile Send private message
ESSPRABHU

New User


Joined: 11 Oct 2005
Posts: 22

PostPosted: Thu Sep 18, 2008 2:07 pm
Reply with quote

Thanks Aaru.....

I used the below code in SYNCSORT and it's working fine.

INREC IFTHEN=(WHEN=INIT,OVERLAY=(172:C'1')),
IFTHEN=(WHEN=(32,2,BI,EQ,X'0000'),OVERLAY=(172:C'0')),
IFTHEN=(WHEN=(32,2,BI,EQ,X'FFFF'),OVERLAY=(172:C'9'))
SORT FIELDS=(172,1,CH,A,9,7,CH,A,39,3,CH,A)
OUTREC FIELDS=(1,171)


Thanks,
Prabhu.
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Thu Sep 18, 2008 3:26 pm
Reply with quote

Prabhu,

You are Welcome.

Quote:
I used the below code in SYNCSORT and it's working fine.


Thats great.

Quote:
IFTHEN=(WHEN=(32,2,BI,EQ,X'0000'),OVERLAY=(172:C'0')),
IFTHEN=(WHEN=(32,2,BI,EQ,X'FFFF'),OVERLAY=(172:C'9'))


As per the code it looks like you are differentiating the header and trailer by the data in the 32nd position. But your sample input in the previous post looks different.
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 FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
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