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 split 1 record into multiple records

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

New User


Joined: 22 Feb 2014
Posts: 16
Location: India

PostPosted: Mon Mar 03, 2014 2:39 am    Post subject: Syncsort split 1 record into multiple records
Reply with quote

Hi, Greetings to all. This is my first post.

I have a file with LRECL 7508 and the records in below format.
Field1 : 8 bytes, alphanumeric
Field2 : 7500 bytes , alphanumeric

Input will be like this

ab123456zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
bcd12345aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

My output file should be in length of 258 bytes, where field1 will be 8 bytes and field 2 should be split in multiples of 250 bytes like below. The records should be split like first line will have 258 bytes and the second line should have first 8 bytes as dots (.) and 250 bytes of field2. Instead of dots(.), spaces are also fine.

Output should be like this:

ab123456zzzzzzzzzzzzz
........zzzzzzzzzzzzz
........zzzzzzzzzzzzz
........zzzzzzzzzzzzz
cd123456aaaaaaaaaaaaa
........aaaaaaaaaaaaa
........aaaaaaaaaaaaa
........aaaaaaaaaaaaa
........aaaaaaaaaaaaa

In syncsort, we do not have RESIZE option like in DFSORT. So we need to do this split without resize option. I can use newline operator '/' to achieve this but I need to use this for 30 times for 7500 length record.
Your suggestions are welcome and thanks in advance.

Regards,
Rajesh
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Mon Mar 03, 2014 3:15 am    Post subject: Reply to: split 1 record into multiple records without RESIZ
Reply with quote

Quote:
Your suggestions are welcome and thanks in advance.

if You had started typing instead of posting You would have finished by now
icon_cool.gif
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Mon Mar 03, 2014 5:02 am    Post subject: Reply to: Syncsort split 1 record into multiple records
Reply with quote

Without RESIZE what you've already suggested is what I'd do. So take enrico's accurate advice.

Code:
  BUILD=(1,8,0009,250,
      /,
       8C'.',0259,250,
      /,
       8C'.',0259,250,
.....



Really easy to R(epeat) in the editor and then type - you can even generate the statements with rexx/SORT/whatever. Edit macro. Once you have one, useful for other tasks.

You can also improve things using symbols/SYMNAMEs.
Back to top
View user's profile Send private message
Rajesh Haridoss

New User


Joined: 22 Feb 2014
Posts: 16
Location: India

PostPosted: Mon Mar 03, 2014 6:16 am    Post subject: Reply to: Syncsort split 1 record into multiple records
Reply with quote

Hi Enrico and bill,
Thanks for the quick reply. The idea behind why I am not using the '/' operator is we are thinking of increasing the size of field2 to 32000 bytes. So I need some other method which can be used to split the records.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Mon Mar 03, 2014 6:38 am    Post subject: Reply to: Syncsort split 1 record into multiple records
Reply with quote

Well, there's always a programming language instead of SORT.

Do you mean 32,0008? Or will the last split record be short?

You are going to have this dataset on tape, or waste a lot of space with it?

Seriously, generate the cards, use symbols/SYMNAMES so you have a generic solution. Where's the problem?
Back to top
View user's profile Send private message
Rajesh Haridoss

New User


Joined: 22 Feb 2014
Posts: 16
Location: India

PostPosted: Mon Mar 03, 2014 9:19 am    Post subject: Reply to: Syncsort split 1 record into multiple records
Reply with quote

Input file LRECL will be 32008. Could you please give me an example to use symbols/SYMNAMES in this case?.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Mon Mar 03, 2014 12:47 pm    Post subject: Reply to: Syncsort split 1 record into multiple records
Reply with quote

Code:
//SYMNAMES DD *
KEY-VALUE,*,8,CH
DATA-001,*,250,CH
DATA-002,*,250,CH
DATA-003,*,250,CH
...
KEY-MASKS,8C' '
//SYMNOUNT DD SYSOUT=*


  OUTFIL BUILD=(KEY-VALUE,DATA-001,
              /,
               KEY-MASKS,DATA-002,
              /,
               KEY-MASKS,DATA-003,
.....


Do the necessary, either by hand or auotmation, then you have something which you can quickly change the sizes on, the content of the mask, whatever, without having to calculate a single position yourself.
Back to top
View user's profile Send private message
Rajesh Haridoss

New User


Joined: 22 Feb 2014
Posts: 16
Location: India

PostPosted: Mon Mar 03, 2014 10:12 pm    Post subject: Reply to: Syncsort split 1 record into multiple records
Reply with quote

Thanks bill!!..This helps me.
Back to top
View user's profile Send private message
Rajesh Haridoss

New User


Joined: 22 Feb 2014
Posts: 16
Location: India

PostPosted: Tue Mar 11, 2014 9:52 am    Post subject: Reply to: Syncsort split 1 record into multiple records
Reply with quote

In the same input with 32000 byte LRECL, There is possibility that lot of bytes will be spaces. when I get no data/spaces for the 250 bytes while splitting the record or after splitting the records, I will get lot of empty lines. I need to remove those empty lines in the output file.I need to remove those empty lines in the same step/sort card. Any suggestions are welcome.
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: copy lines after the keyword shreya19 SYNCSORT 1 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
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts Syncsort - Hard coded Value in output PORYES SYNCSORT 1 Thu Nov 03, 2016 9:23 am
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm


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