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 Skipping Records + Variable to Fixed

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

New User


Joined: 02 Nov 2006
Posts: 10

PostPosted: Thu May 22, 2008 5:51 am    Post subject: SYNCSORT Skipping Records + Variable to Fixed
Reply with quote

Hi,

1. I have a variable length file. I want to know if there is a Sort Utility which would eliminate the first and the last record (the ones marked blue in the file layout). I dont know the number of records in the file.

2. I want to know if there is a way I can convert the Variable length record to a fixed length record.

My requirements are such that from the variable file, I want only a part of the variable data and I dont need the fixed data. I tried using the OUTREC option for variable fields and also tried using the CONVERT option, both of which failed.

Say the file is 32756 bytes and I have fixed data to 200 bytes. I want only the variable data and from the 201st byte (want only the part which is marked in Red).

File Layout:

ABCDE<<<<<<
12324........frgreghrthrwrgs
343525......asdfd
53532353...lkdfgs
450439......dfkdjfldkf
CLKDFD<<<<<>

Sriram
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Thu May 22, 2008 11:26 am    Post subject:
Reply with quote

There are a lot of examples in the forum showing how this can be done, so,

a) Have you searched the forum looking at some examples.
b) Have you read your sort documentation.
c) If you have tried for yourself - please post your code and error messages.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Thu May 22, 2008 1:25 pm    Post subject: Re: SYNCSORT Skipping Records + Variable to Fixed
Reply with quote

sriramd wrote:
1. I have a variable length file. I want to know if there is a Sort Utility which would eliminate the first and the last record (the ones marked blue in the file layout). I dont know the number of records in the file.
yes, INCLUDE/OMIT if you can uniqicly identify the records that you want to skip....
Quote:
2. I want to know if there is a way I can convert the Variable length record to a fixed length record.
yes....
Quote:
My requirements are such that from the variable file, I want only a part of the variable data and I dont need the fixed data. I tried using the OUTREC option for variable fields and also tried using the CONVERT option, both of which failed.
Fixed data in a variable file? What is the recfm and lrecl of the input?
Quote:
File Layout:
Code:
ABCDE<<<<<<
12324........frgreghrthrwrgs
343525......asdfd
53532353...lkdfgs
450439......dfkdjfldkf
CLKDFD<<<<<>
Does this represent your data?
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 500
Location: USA

PostPosted: Thu May 22, 2008 9:50 pm    Post subject:
Reply with quote

Quote:
Say the file is 32756 bytes and I have fixed data to 200 bytes. I want only the variable data and from the 201st byte

Try this:
Code:
//STEP1 EXEC PGM=SORT
//SYSOUT  DD SYSOUT=*
//SORTIN  DD DISP=SHR,DSN=INPUT.DATA.VB
//SORTOUT DD DISP=(NEW,CATLG),DSN=OUTPUT.DATA.FB
//SYSIN   DD  *
   SORT FIELDS=COPY
   OUTFIL OUTREC=(205,32556),                 >>> 201 + 4 byte RDW
     INCLUDE=(5,5,CH,NE,C'ABCDE',AND,         >>> Header and Trailer start
              5,5,CH,NE,C'CLKDF'),CONVERT         in first data position after RDW
/*
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 500
Location: USA

PostPosted: Thu May 22, 2008 9:53 pm    Post subject:
Reply with quote

The above code got misaligned even though the preview looked fine. Here is a better version of the code:
Code:

//STEP1 EXEC PGM=SORT
//SYSOUT  DD SYSOUT=*
//SORTIN  DD DISP=SHR,DSN=INPUT.DATA.VB
//SORTOUT DD DISP=(NEW,CATLG),DSN=OUTPUT.DATA.FB
//SYSIN   DD  *
   SORT FIELDS=COPY
   OUTFIL OUTREC=(205,32556),
    INCLUDE=(5,5,CH,NE,C'ABCDE',AND,   
             5,5,CH,NE,C'CLKDF'),CONVERT 
/*
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 Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm


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