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
 

 

Update the Sortout file with record count at defined pos

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> SYNCSORT
View previous topic :: :: View next topic  
Author Message
karthik_sripal

New User


Joined: 28 Mar 2008
Posts: 67
Location: 125.16.180.5

PostPosted: Tue May 17, 2016 8:52 pm    Post subject: Update the Sortout file with record count at defined pos
Reply with quote

Hello,

I would like to the count the number of records in sortin and update the record count at a certain posistion in the sortout file.

I am currently using
Code:


//STEP01 EXEC PGM=SYNCSORT                                             
//*                                                                     
//SORTIN   DD  *                                                       
10                                                                     
20                                                                     
30                                                                     
40                                                                     
/*                                                                     
//SORTOUT  DD  DSN=Test.sort.out.ps,DISP=SHR                   
//*                                                                     
//SYSIN    DD  *                                                       
   SORT FIELDS=COPY                                                     
   OUTFIL REMOVECC,NODETAIL,                                           
    TRAILER1=('NO OF RECORDS: ',COUNT=(M11,LENGTH=8))                   
//*                                                                     
//SYSPRINT DD  SYSOUT=*                                                 
//SYSOUT   DD  SYSOUT=*                                                 
//SYSUDUMP DD  SYSOUT=*                                                 



But - This sort card wipes out all the contents of the file I have in Test.sort.out.ps and prints the trailer line only whereas I would like to retain the content of the sortout file but only change a particular record and update it with record count from sortin.

How could I acheive this ? Thank you for your help!
Back to top
View user's profile Send private message

Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1609
Location: NY,USA

PostPosted: Tue May 17, 2016 8:57 pm    Post subject:
Reply with quote

Get rid of
Code:
NODETAIL
.
Back to top
View user's profile Send private message
karthik_sripal

New User


Joined: 28 Mar 2008
Posts: 67
Location: 125.16.180.5

PostPosted: Tue May 17, 2016 9:03 pm    Post subject:
Reply with quote

Thank you very much for the quick response - but getting rid of Nodetail - gives me the records from sortin in my sortout - I dont want that either.

I would like to have the content - whatever is currently in the sortout to remain there and yet just replace/overlay only a certain row in my sortout with the count of the sortin records
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1609
Location: NY,USA

PostPosted: Tue May 17, 2016 9:09 pm    Post subject:
Reply with quote

Quote:
I would like to retain the content of the sortout file but only change a particular record and update it with record count from sortin.

Quote:
replace/overlay only a certain row in my sortout with the count of the sortin records

How do you identify the record then? and why
Code:
Test.sort.out.ps
is in SORTOUT can you tell? you ideally wants to use in SORTIN and then process the logic and overlay the identified records and copy everything to SORTOUT.
Back to top
View user's profile Send private message
karthik_sripal

New User


Joined: 28 Mar 2008
Posts: 67
Location: 125.16.180.5

PostPosted: Tue May 17, 2016 9:11 pm    Post subject:
Reply with quote

Thanks again - Say the 10th record, 10th col - we want to overlay with count of records from sortin
Back to top
View user's profile Send private message
karthik_sripal

New User


Joined: 28 Mar 2008
Posts: 67
Location: 125.16.180.5

PostPosted: Tue May 17, 2016 9:14 pm    Post subject:
Reply with quote

My sortout file - Test.sort.out.ps is like this

Code:

Dat1
Dat2
Dat3


and say I want like my output like

Code:

Dat1
Dat2
Dat3 - sortin count - 4
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1609
Location: NY,USA

PostPosted: Tue May 17, 2016 10:17 pm    Post subject:
Reply with quote

Tested.
Code:
//S1    EXEC  PGM=ICEMAN                                       
//SYSOUT    DD  SYSOUT=*                                       
//SORTIN DD *                                                 
10                                                             
20                                                             
30                                                             
40                                                             
//SYM DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)   
//SYSIN    DD    *                                             
   OPTION COPY                                                 
   OUTFIL FNAMES=SYM,REMOVECC,NODETAIL,                       
     BUILD=(80X),                                             
     TRAILER1=('CNT,''',COUNT=(M11,LENGTH=4),C'''')           
//S2    EXEC  PGM=ICEMAN                   
//SYSOUT    DD  SYSOUT=*                   
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)     
//SORTIN DD *                               
DAT1                                       
DAT2                                       
DAT3                                       
//SORTOUT DD SYSOUT=*                       
//SYSIN    DD    *                         
   OPTION COPY                             
   INREC IFTHEN=(WHEN=(1,4,CH,EQ,C'DAT3'), 
     OVERLAY=(6:C'- NO OF RECORDS - ',CNT))


You may also be able to do with joinkeys and seq no concept.
Back to top
View user's profile Send private message
karthik_sripal

New User


Joined: 28 Mar 2008
Posts: 67
Location: 125.16.180.5

PostPosted: Wed May 18, 2016 12:17 am    Post subject:
Reply with quote

Thank you very much!
Back to top
View user's profile Send private message
John Del

New User


Joined: 27 Apr 2012
Posts: 20
Location: NY

PostPosted: Wed May 18, 2016 12:41 am    Post subject:
Reply with quote

Sortout with DISP=MOD instead of SHR

Edit to add - nevermind, missed that the OP wanted to modify a data record in the output dsn instead of preserve the data record in the sortout dataset.

Except for a log, I never liked to see SHR (or MOD) coded on sortout datasets.
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 -> SYNCSORT All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts -913/-911 Deadlock during UPDATE stat... NoSleep319 DB2 5 Fri Nov 18, 2016 12:37 am
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm


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