IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Formatting multiple records to a single record!!


IBM Mainframe Forums -> SYNCSORT
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Vignesh Sid

New User


Joined: 04 Sep 2017
Posts: 43
Location: India

PostPosted: Tue Nov 07, 2017 12:22 pm
Reply with quote

Hi all,

I have an input file of 50 record length and fixed block.

Code:
  WER405I  SORTOF02 :  DATA RECORDS OUT          0
  WER405I  SORTOF03 :  DATA RECORDS OUT          0
  WER405I  SORTOF04 :  DATA RECORDS OUT          2
  WER405I  SORTOF05 :  DATA RECORDS OUT         18

I need an output file like: rec length 50 and FB

Code:
END 0000000000 0000000000 0000000002 0000000018

Could anyone help me with a sort card to achieve this?

Thanks!
Back to top
View user's profile Send private message
Vignesh Sid

New User


Joined: 04 Sep 2017
Posts: 43
Location: India

PostPosted: Tue Nov 07, 2017 12:56 pm
Reply with quote

Hi all,

I used the following card to get the count:

Code:
//SORT1   EXEC PGM=SORT                             
//SYSOUT   DD SYSOUT=*                               
//SORTIN   DD DSN=XBBNGBB.TEST.COUNT,DISP=SHR       
//SORTOUT  DD DSN=XBBNGBB.TEST.COUNT1,               
//            DISP=(NEW,CATLG,DELETE),UNIT=SYSDA,   
//            DCB=(RECFM=FBS,LRECL=10,BLKSIZE=0),   
//            SPACE=(CYL,(500,500),RLSE)             
//SYSIN    DD *                                     
  SORT FIELDS=COPY                                   
  OUTFIL FNAMES=SORTOUT,INCLUDE=(24,4,CH,EQ,C'DATA'),
  BUILD=(1:41,10)                                   
/*                                                   

The output is:
         0
         0
         2
        18

Can anyone tell me how to write this is in a single record as explained above.

And I dont know how the spaces are getting deleted while copying the code...Also suggest me how to paste the mainframe display as such.

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

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Tue Nov 07, 2017 4:29 pm
Reply with quote

Vignesh Sid wrote:
And I dont know how the spaces are getting deleted while copying the code...Also suggest me how to paste the mainframe display as such.

Thanks!
Above the box where you type your question, there are a few buttons (B, i, u and so on). "Code" is the button you need: click on Code, paste your screen as text, then click again on Code. Alternatively, select some text then click on Code. All selected text will be within Code tags.

About your other question, here is the beginning of the answer:
Code:
//* ******************************************* */
//* LOAD TEMPORARY FILE WITH TEMPORARY DATA     */
//* ******************************************* */
//STEP01   EXEC PGM=IEBGENER                     
//SYSUT1   DD   *                                 
  WER405I  SORTOF02 :  DATA RECORDS OUT          0
  WER405I  SORTOF03 :  DATA RECORDS OUT          0
  WER405I  SORTOF04 :  DATA RECORDS OUT          2
  WER405I  SORTOF05 :  DATA RECORDS OUT         18
//SYSUT2   DD   DISP=(NEW,PASS,DELETE),DSN=&INP, 
// DCB=(RECFM=FB,LRECL=80)                       
//* ******************************************* */
//* JOIN LINES                                  */
//* ******************************************* */
//STEP02   EXEC PGM=SYNCTOOL                     
//TOOLMSG  DD   SYSOUT=*                         
//SSMSG    DD   SYSOUT=*                         
//INP      DD   DISP=(OLD,DELETE),DSN=&INP       
//OUT      DD   SYSOUT=*                         
//TOOLIN   DD   *                                 
RESIZE FROM(INP) TO(OUT) TOLEN(60) USING(CTL1)   
//CTL1CNTL DD   *                                 
   INREC BUILD=(41,10)                           
//* ******************************************* */

Now,Syncsort did not provide documentation for SYNCTOOL (but it is there and you should try it) but you could google for "ICETOOL DOCUMENTATION" and find something interesting.
Back to top
View user's profile Send private message
Vignesh Sid

New User


Joined: 04 Sep 2017
Posts: 43
Location: India

PostPosted: Tue Nov 07, 2017 6:03 pm
Reply with quote

Thanks Marso. It is working and I got the desired output!


Code:
//STEP3  EXEC PGM=ICETOOL                     
//SYSPRINT DD SYSOUT=*                         
//IN1     DD DISP=SHR,DSN=XBBNGBB.TEST.COUNT1 
//OUT1    DD DSN=XBBNGBB.TEST.COUNT2,         
//           DISP=(OLD,CATLG,DELETE),         
//           SPACE=(CYL,(5,1),RLSE),UNIT=SYSDA,
//           DCB=(RECFM=FB,LRECL=40,BLKSIZE=0)
//TOOLMSG DD SYSOUT=*                         
//DFSMSG DD SYSOUT=*                           
//TOOLIN DD *                                 
   RESIZE FROM(IN1) TO(OUT1) TOLEN(40)         
//*


This code worked in syncsort! Thanks for explaining the code option icon_biggrin.gif[/code]
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> SYNCSORT

 


Similar Topics
Topic Forum Replies
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
Search our Forums:

Back to Top