Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
SYNCSORT-write records next to next !

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

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Sat Feb 26, 2011 10:44 am    Post subject: SYNCSORT-write records next to next !
Reply with quote

Hi,

Input File: LRECL=8, RECFM=FB
Code:

RECORD01
RECORD02
RECORD03
RECORD04
.......
.......
RECORDnn


I have the above input file which has record one after another. I want to copy those records into output dataset with LRECL=16, RECFM=FB but records written next to next.

Expected Output-1: LRECL=16,RECFM=FB
Code:

RECORD01RECORD02
RECORD03RECORD04
..........
..........
RECORDnn


Expected Output-2: LRECL=24,RECFM=FB
Code:

RECORD01RECORD02RECORD03
RECORD04RECORD05RECORD06
..........
..........
RECORDnn


Would you please let me know how to achieve it using SORT? Also, what changes in control cards need if it has to be three records per line?

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

Arun Raj

Moderator


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

PostPosted: Sat Feb 26, 2011 5:57 pm    Post subject:
Reply with quote

ramsri,

Here's a Syncsort job which works for your requirement (Expected Output-2). It can be modified to get Output-1 as well.
Code:
//STEP01   EXEC PGM=SORT                                   
//SYSOUT   DD   SYSOUT=*                                   
//SORTOUT  DD   SYSOUT=*                                   
//SORTIN   DD   *                                           
RECORD01                                                   
RECORD02                                                   
RECORD03                                                   
RECORD04                                                   
RECORD05                                                   
RECORD06                                                   
RECORD07                                                   
RECORD08                                                   
//SYSIN    DD   *                                           
  INREC IFTHEN=(WHEN=GROUP,RECORDS=3,PUSH=(81:ID=5,SEQ=1)),
        IFTHEN=(WHEN=INIT,OVERLAY=(87:1,8,16Z)),           
        IFTHEN=(WHEN=(86,1,ZD,EQ,2),OVERLAY=(095:1,8)),     
        IFTHEN=(WHEN=(86,1,ZD,EQ,3),OVERLAY=(103:1,8))     
  SORT FIELDS=(81,5,CH,A)                                   
  SUM FIELDS=(95,4,99,4,103,4,107,4),FORMAT=BI             
  OUTREC BUILD=(87,24) 
SORTOUT had
Code:
RECORD01RECORD02RECORD03 
RECORD04RECORD05RECORD06 
RECORD07RECORD08                       
Back to top
View user's profile Send private message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Tue Mar 01, 2011 3:10 pm    Post subject: thanks
Reply with quote

Arun, thanks. I'll try it and come back.
Back to top
View user's profile Send private message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Tue Mar 01, 2011 3:20 pm    Post subject: Reply to: SYNCSORT-write records next to next !
Reply with quote

Hi Arun, I've tried your code and got expected results icon_biggrin.gif

I've modified value of RECORDS parameter from 3 to 2 and got the results.

Code:

//SYSIN    DD *                                             
  INREC IFTHEN=(WHEN=GROUP,RECORDS=2,PUSH=(81:ID=5,SEQ=1)),


One thing I would like to ask why to use FORMAT=BI.

Code:

SUM FIELDS=(95,4,99,4,103,4,107,4),FORMAT=BI


Thanks a lot.
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Fri Mar 04, 2011 12:36 am    Post subject:
Reply with quote

The objective of the binary SUM here is to 'ADD' binary zeroes and the binary value of 'RECORDnn' giving 'RECORDnn' itself. It might help if you have a look at the intermediate output by removing the SUM and OUTREC statements.
Back to top
View user's profile Send private message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Fri Mar 04, 2011 9:12 am    Post subject: I will try
Reply with quote

Hi Arun, I will try and see it.

Thanks.
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 Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts Join records from 2 files with No Dup... Poha Eater DFSORT/ICETOOL 21 Sun Aug 27, 2017 10:35 pm
No new posts Match two files using multiple keys a... santoshks1987 SYNCSORT 11 Fri Aug 18, 2017 10:50 am
No new posts Read two inputs and write into output... murali.andaluri DFSORT/ICETOOL 6 Wed Jul 26, 2017 7:35 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us