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
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: How to sort a file, having header and trailer in SYNCSORT
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: 1703
Location: Australia

PostPosted: Thu Sep 18, 2008 10:57 am    Post subject:
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: 2180
Location: @my desk

PostPosted: Thu Sep 18, 2008 11:00 am    Post subject:
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    Post subject: How can we do it in SYNCSORT or FILEAID batch?
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    Post subject: No ICETOOL please......
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    Post subject: We are using SYNCSORT, that's please provide the solution in
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: 1288
Location: Chennai, India

PostPosted: Thu Sep 18, 2008 3:26 pm    Post subject: Reply to: How to sort a file, having header and trailer in S
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    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 SYNCSORT SEQNUM and FI fields. nartcr SYNCSORT 5 Sat Jan 21, 2017 4:02 am
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am


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