View previous topic :: View next topic
|
Author |
Message |
karthik_sripal
New User
Joined: 28 Mar 2008 Posts: 69 Location: 125.16.180.5
|
|
|
|
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 |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3051 Location: NYC,USA
|
|
|
|
Get rid of
. |
|
Back to top |
|
|
karthik_sripal
New User
Joined: 28 Mar 2008 Posts: 69 Location: 125.16.180.5
|
|
|
|
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 |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3051 Location: NYC,USA
|
|
|
|
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
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 |
|
|
karthik_sripal
New User
Joined: 28 Mar 2008 Posts: 69 Location: 125.16.180.5
|
|
|
|
Thanks again - Say the 10th record, 10th col - we want to overlay with count of records from sortin |
|
Back to top |
|
|
karthik_sripal
New User
Joined: 28 Mar 2008 Posts: 69 Location: 125.16.180.5
|
|
|
|
My sortout file - Test.sort.out.ps is like this
and say I want like my output like
Code: |
Dat1
Dat2
Dat3 - sortin count - 4
|
|
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3051 Location: NYC,USA
|
|
|
|
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 |
|
|
karthik_sripal
New User
Joined: 28 Mar 2008 Posts: 69 Location: 125.16.180.5
|
|
|
|
Thank you very much! |
|
Back to top |
|
|
John Del
New User
Joined: 27 Apr 2012 Posts: 42 Location: NY
|
|
|
|
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 |
|
|
|