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: 2361
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: 2361
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 MXG - Processing Compressed DB2 SMF r... vasanthz All Other Mainframe Topics 2 Thu May 10, 2018 12:47 am
No new posts Reformatting and adding additional fi... Badbeef SYNCSORT 6 Thu Apr 05, 2018 4:45 pm
No new posts Extract the records with a PD field's... sudhakar84 DFSORT/ICETOOL 11 Mon Apr 02, 2018 7:26 pm
No new posts Merge 2 records sancraig16 SYNCSORT 19 Tue Mar 27, 2018 8:17 pm
No new posts Copy set of records based on condition krish.deepu SYNCSORT 2 Thu Mar 08, 2018 11:39 am

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