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

SYNCSORT Card for Summing occurs fields


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
miosne
Warnings : 1

New User


Joined: 13 Mar 2006
Posts: 63
Location: italy

PostPosted: Fri Oct 19, 2007 7:17 pm
Reply with quote

HI all,

Can I write a sort card to make a sum for this recin format??

01 ENFP08S-REC.
05 ENFP08S-DETT OCCURS 100.
10 ENFP08S-SIGN PIC X(001) VALUE SPACE.
10 ENFP08S-IMPO PIC Z.ZZZ.ZZZ.ZZZ.ZZ9,99.
10 ENFP08S-PV-06 PIC X(001) VALUE SPACE.

Thanks a lot
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Fri Oct 19, 2007 7:47 pm
Reply with quote

miosne
Quote:
Can I write a sort card to make a sum for this recin format??
You may, but which field you want to sum and based on which field you want to sum(KEY).

Provide the sample i/p and o/p records.
With i/p and o/p file LRECL and RECFM
Back to top
View user's profile Send private message
miosne
Warnings : 1

New User


Joined: 13 Mar 2006
Posts: 63
Location: italy

PostPosted: Mon Oct 22, 2007 12:51 pm
Reply with quote

I want only make a SUM FIELDS on the ENFP08S-IMPO.
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Mon Oct 22, 2007 3:12 pm
Reply with quote

miosne
As i asked before
Quote:
Provide the sample i/p and o/p records.
With i/p and o/p file LRECL and RECFM
Back to top
View user's profile Send private message
miosne
Warnings : 1

New User


Joined: 13 Mar 2006
Posts: 63
Location: italy

PostPosted: Mon Oct 22, 2007 3:16 pm
Reply with quote

sory, the key is ENFP08S-PV-06.

Thanks a lot
Back to top
View user's profile Send private message
miosne
Warnings : 1

New User


Joined: 13 Mar 2006
Posts: 63
Location: italy

PostPosted: Mon Oct 22, 2007 7:05 pm
Reply with quote

I'll try to put al the infromations needs.

The sort key is ENFP08S-CAGNZ.
The file lenght is 2500.
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Mon Oct 22, 2007 10:04 pm
Reply with quote

Quote:
The sort key is ENFP08S-CAGNZ.
in the initial file layout, you havent shown this variable at all icon_question.gif
Back to top
View user's profile Send private message
miosne
Warnings : 1

New User


Joined: 13 Mar 2006
Posts: 63
Location: italy

PostPosted: Tue Oct 23, 2007 12:46 pm
Reply with quote

no.
I've moved only a portion of the file.
:-(
Sorry
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Tue Oct 23, 2007 1:12 pm
Reply with quote

Code:
01 ENFP08S-REC.
05 ENFP08S-DETT OCCURS 100.
10 ENFP08S-SIGN PIC X(001) VALUE SPACE.
10 ENFP08S-IMPO PIC Z.ZZZ.ZZZ.ZZZ.ZZ9,99.
10 ENFP08S-PV-06 PIC X(001) VALUE SPACE.

in this layout,
1. what is the SORT-KEY? and
2. Which field you want to SUM?
3. LRECL of the File?
4. REFCM of the file?
Back to top
View user's profile Send private message
miosne
Warnings : 1

New User


Joined: 13 Mar 2006
Posts: 63
Location: italy

PostPosted: Tue Oct 23, 2007 1:32 pm
Reply with quote

the sort key is enfp08s-pv-06
the field to sum is enfp08s-impo
the lrecl is 2500
the recfm is FB

thank you for your patience.
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Tue Oct 23, 2007 2:42 pm
Reply with quote

If your SORT KEY falls with in OCCURS, you will have 100 SORT KEY's icon_exclaim.gif
Are you sure about the Layout.

OR
Do you want to SUM
ENFP08S-IMPO(1) + ENFP08S-IMPO(2) + ENFP08S-IMPO(3) + .... +ENFP08S-IMPO(100) for each record?
Back to top
View user's profile Send private message
miosne
Warnings : 1

New User


Joined: 13 Mar 2006
Posts: 63
Location: italy

PostPosted: Tue Oct 23, 2007 2:51 pm
Reply with quote

the both situations are my problem!!!! icon_redface.gif
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10886
Location: italy

PostPosted: Tue Oct 23, 2007 3:00 pm
Reply with quote

To get useful answers there must be an agreement on terms

a file is composed of records,
for sorting purposes each record must have a key
( uniquely defined - with the key tokens in a fixed position )

What You call a key enfp08s-pv-06 looks like an index
and we are not even sure that all the entries will be filled,
so ( by sort terminology ) enfp08s-pv-06 does not qualify as a key

unless... You provided incomplete info..

naturally there is nothing wrong in asking on how to sum across columns,

but the terms must be clear
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Tue Oct 23, 2007 3:02 pm
Reply with quote

Quote:
the both situations are my problem!!!!

Then do you want to sum ENFP08S-IMPO(1) + ENFP08S-IMPO(2) + ENFP08S-IMPO(3) + .... +ENFP08S-IMPO(100) for each record?

Example: IF i/p is
Code:

AAAAA 12.34 34.45 62.43
BBBBB 32.43 54.23 34.54

Do you expect the o/p to be
Code:

AAAAA 109.22
BBBBB 121.20
Back to top
View user's profile Send private message
miosne
Warnings : 1

New User


Joined: 13 Mar 2006
Posts: 63
Location: italy

PostPosted: Tue Oct 23, 2007 3:10 pm
Reply with quote

I want, if it's possible, to having this situation

occ-1 occ-2 occ-3 occ-100
AAAAA 12.34 34.45 62.43 .... 109.22
BBBBB 32.43 54.23 34.54 .... 121.20
.
.
.
total 44.77 88.68 96.97
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Tue Oct 23, 2007 10:45 pm
Reply with quote

miosne
Since you havent given expected o/p and enough senarios, i have to ask some sample example and expected o/p
If the i/p has
Code:

AAAAA 12.34 AAAB 34.45 AAAD62.43
BBBBB 32.43 AAAC 54.23 AAAD34.54
AAA1A 12.34 AAAB 34.45 AAAD62.43
BBBBB 32.43 AA1C 54.23 3AAD34.54

What is your expected o/p, where (AAAA,BBBB,AAAB,AAAC.....) are your SORT keys?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Tue Oct 23, 2007 11:40 pm
Reply with quote

Hi Krisprems,

If you revert back to Miosne's previous post and your previous post, notice that you created a horizontal sum - all of the values for the key.

What i believe is needed is a column (vertical) total for the fields.

If i've misunderstood, i'm sure i'll be informed icon_smile.gif
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Wed Oct 24, 2007 8:27 am
Reply with quote

Hi dick
Since the layout was an OCCURS of 100, i guessed the sum would be Horizontal. After Miosne's post, looks like its typical Vertical SUMMING.

But since the For each occurance there would be key, i wonder how would be the o/p is expected(as i have given my sample i/p in my previous post let me wait and watch for the expected o/p) icon_question.gif
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Wed Oct 24, 2007 8:39 am
Reply with quote

Hi Krisprems,

Quote:
let me wait and watch for the expected o/p
Yes, that would be good.

My current/newest guess is that both line totals and column totals are needed.

We'll see later today icon_smile.gif
Back to top
View user's profile Send private message
miosne
Warnings : 1

New User


Joined: 13 Mar 2006
Posts: 63
Location: italy

PostPosted: Wed Oct 24, 2007 12:48 pm
Reply with quote

I need line and column total. icon_biggrin.gif
Back to top
View user's profile Send private message
miosne
Warnings : 1

New User


Joined: 13 Mar 2006
Posts: 63
Location: italy

PostPosted: Wed Oct 24, 2007 1:08 pm
Reply with quote

krisprems wrote:
miosne
Since you havent given expected o/p and enough senarios, i have to ask some sample example and expected o/p
If the i/p has
Code:

AAAAA 12.34 AAAB 34.45 AAAD62.43
BBBBB 32.43 AAAC 54.23 AAAD34.54
AAA1A 12.34 AAAB 34.45 AAAD62.43
BBBBB 32.43 AA1C 54.23 3AAD34.54

What is your expected o/p, where (AAAA,BBBB,AAAB,AAAC.....) are your SORT keys?


this is my example that i've posted
occ 1 occ 2 occ 3 occ 100
AAAAA 12.34 34.45 62.43 .... 109.22
ABBBB 32.43 54.23 34.54 .... 121.20
.
.
.
total 44.77 88.68 96.97 230.42

My vertical key is the first byte of every record(enfp08s-cagnz in the copy)

for each line i need that the occurs from 1 until 99 was summed in the occurs 100.

I hope that I've not created more confusion
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10886
Location: italy

PostPosted: Wed Oct 24, 2007 1:31 pm
Reply with quote

the murky point are the keys...

will they always be 1 to 99

will they always be ordered

with a one byte key You will have only 256 different records ( maybe duplicates )

Just curious but what is the business background in all this ???


I just looked at the data You provided,
and found something interesting
the key is two bytes and not one

since it is clearly an excel spreadsheet layout
case :
1) uploaded ... carry on the across computations in EXCEL
2) program generated ... have the program do the same
extreme solution
why not do everything in EXCEL ???
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10886
Location: italy

PostPosted: Wed Oct 24, 2007 1:44 pm
Reply with quote

I do not really care for sort problems,
but I am very curious about the logic of asking and replying and providing
information about one' s problem.
and why still after 21 post the data layout is not clear

Not meant to offend, but You kept providing misleading information

Your data consistes clearly of comma/semi_colon separated values

ok for the plus sign, ok for the amount
but why in heaven You call enfp08s-pv-06 a key when
from the data You provided it is simply the separator of an EXCEL like layout

to conclude the across sum is a sum of "occurs clause" items with no key
Back to top
View user's profile Send private message
miosne
Warnings : 1

New User


Joined: 13 Mar 2006
Posts: 63
Location: italy

PostPosted: Wed Oct 24, 2007 1:49 pm
Reply with quote

Mi sembra che cosa vi sia dietro a questo lavoro non debba essere l'argomento del contendere.

Pensavo che, in questo luogo si potessero soddisfare curiosità ed affrontare problematiche che si possono risolvere in molti modi, a discrezione del singolo quale sia la migliore.

Mi chiedi come mai non si esegue in excel?
Se sono qui per porre domande a chi ne sa più di me, non dovresti chiederti come mai o perchè, ma aiutarmi nel risolvere, se possibile, un mio problema.

Saluti.
Back to top
View user's profile Send private message
miosne
Warnings : 1

New User


Joined: 13 Mar 2006
Posts: 63
Location: italy

PostPosted: Wed Oct 24, 2007 1:52 pm
Reply with quote

Il mio inglese non'è così evoluto da consentirmi di essere chiaro.
E soprattutto io cerco di porre un'esempio che sia sintetico, senza scendere nel particolare, perchè, vista la mia curiosità, vorrei evolvere un qualcosa mettendoci un po' del mio.

Senza rancore, Miosne.
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 -> JCL & VSAM Goto page 1, 2  Next

 


Similar Topics
Topic Forum Replies
No new posts Syncsort help SYNCSORT 3
No new posts SORT CARD meaning please DFSORT/ICETOOL 3
No new posts SYNCSORT-DB2 interface SYNCSORT 0
No new posts Add condition to a FINDREP SORT card DFSORT/ICETOOL 4
No new posts Pull data using date difference betwe... DB2 6
Search our Forums:

Back to Top