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

DFSORT logic problem


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
useit

Active User


Joined: 05 Oct 2006
Posts: 152

PostPosted: Tue Dec 21, 2010 12:03 pm
Reply with quote

skolusu,
i tried this jcl and it is working fine:) Once again my personal thanks for helping me out in quick time...

also please tell me how do u decide the position of sequence number and push id.

ex:PUSH=(73:ID=8,82:SEQ=2)

if my input LRECL=205. AND OUTPUT LRECL=99. what would be my push & seq number position)
Back to top
View user's profile Send private message
useit

Active User


Joined: 05 Oct 2006
Posts: 152

PostPosted: Tue Dec 21, 2010 3:33 pm
Reply with quote

hi,


one more similar exam i tried to execute it.but it failed with soc7.
input lrecl=205, output lrecl=99

1-39 key data.


my input layout is as below.

01 REC.
07 KEY-DATA PIC X(39).
07 CALC-DATA.
09 EXPIRE PIC S9(5)V99 COMP-3.
09 SOH PIC S9(5)V99 COMP-3.
09 SALES PIC S9(5)V99 COMP-3.
07 FILLER PIC X(154).

please see the below jcl:

//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=INPUT.FILE,DISP=SHR
//SORTOUT DD DSN=OUTPUT.FILE,DISP=SHR
//SYSIN DD *
INREC IFTHEN=(WHEN=INIT,BUILD=(1,39,9X'0000000C',40,12,X'1C')),
IFTHEN=(WHEN=GROUP,BEGIN=(39,1,CH,EQ,C'X'),
PUSH=(113:ID=8,122:SEQ=2)),
IFTHEN=(WHEN=(122,2,ZD,EQ,02),OVERLAY=(40:100,12,121:C'A')),
IFTHEN=(WHEN=(122,2,ZD,EQ,03),OVERLAY=(52:100,12,121:C'A')),
IFTHEN=(WHEN=(122,2,ZD,EQ,04),OVERLAY=(64:100,12,121:C'A')),
IFTHEN=(WHEN=(122,2,ZD,EQ,05),OVERLAY=(76:100,12,121:C'A')),
IFTHEN=(WHEN=(122,2,ZD,EQ,06),OVERLAY=(88:100,12,121:C'A')),
IFTHEN=(WHEN=(122,2,ZD,EQ,07),OVERLAY=(39X,100,12,121:C'B')),
IFTHEN=(WHEN=(122,2,ZD,EQ,08),OVERLAY=(39X,52:100,12,121:C'B')),
IFTHEN=(WHEN=(122,2,ZD,EQ,09),OVERLAY=(39X,64:100,12,121:C'B')),
IFTHEN=(WHEN=(122,2,ZD,EQ,10),OVERLAY=(39X,76:100,12,121:C'B')),
IFTHEN=(WHEN=(122,2,ZD,EQ,11),OVERLAY=(39X,88:100,12,121:C'B')),

IFTHEN=(WHEN=(122,2,ZD,EQ,12),OVERLAY=(39X,100,12,121:C'C')),
IFTHEN=(WHEN=(122,2,ZD,EQ,13),OVERLAY=(39X,52:100,12,121:C'C')),
IFTHEN=(WHEN=(122,2,ZD,EQ,14),OVERLAY=(39X,64:100,12,121:C'C')),
IFTHEN=(WHEN=(122,2,ZD,EQ,15),OVERLAY=(39X,76:100,12,121:C'C')),
IFTHEN=(WHEN=(122,2,ZD,EQ,16),OVERLAY=(39X,88:100,12,121:C'C')),

IFTHEN=(WHEN=(122,2,ZD,EQ,17),OVERLAY=(39X,100,12,121:C'D')),
IFTHEN=(WHEN=(122,2,ZD,EQ,18),OVERLAY=(39X,52:100,12,121:C'D')),
IFTHEN=(WHEN=(122,2,ZD,EQ,19),OVERLAY=(39X,64:100,12,121:C'D')),
IFTHEN=(WHEN=(122,2,ZD,EQ,20),OVERLAY=(39X,76:100,12,121:C'D')),
IFTHEN=(WHEN=(122,2,ZD,EQ,21),OVERLAY=(39X,88:100,12,121:C'D')),

IFTHEN=(WHEN=(122,2,ZD,EQ,22),OVERLAY=(39X,100,12,121:C'E')),
IFTHEN=(WHEN=(122,2,ZD,EQ,23),OVERLAY=(39X,52:100,12,121:C'E')),
IFTHEN=(WHEN=(122,2,ZD,EQ,24),OVERLAY=(39X,64:100,12,121:C'E')),
IFTHEN=(WHEN=(122,2,ZD,EQ,25),OVERLAY=(39X,76:100,12,121:C'E')),
IFTHEN=(WHEN=(122,2,ZD,EQ,26),OVERLAY=(39X,88:100,12,121:C'E')),

IFTHEN=(WHEN=(122,2,ZD,EQ,27),OVERLAY=(39X,100,12,121:C'F')),
IFTHEN=(WHEN=(122,2,ZD,EQ,28),OVERLAY=(39X,52:100,12,121:C'F')),
IFTHEN=(WHEN=(122,2,ZD,EQ,29),OVERLAY=(39X,64:100,12,121:C'F')),
IFTHEN=(WHEN=(122,2,ZD,EQ,30),OVERLAY=(39X,76:100,12,121:C'F')),
IFTHEN=(WHEN=(122,2,ZD,EQ,31),OVERLAY=(39X,88:100,12,121:C'F'))

SORT FIELDS=(113,9,CH,A),EQUALS

SUM FIELDS=(40,4,44,4,48,4,52,4,56,4,60,4,
64,4,68,4,72,4,76,4,80,4,84,4,88,4,92,4,
96,4,112,1),FORMAT=PD
OUTREC IFOUTLEN=99,
IFTHEN=(WHEN=(39,1,CH,EQ,C'X'),OVERLAY=(40:60X)),
IFTHEN=(WHEN=(112,1,PD,EQ,1),OVERLAY=(52:48X)),
IFTHEN=(WHEN=(112,1,PD,EQ,2),OVERLAY=(64:36X)),
IFTHEN=(WHEN=(112,1,PD,EQ,3),OVERLAY=(76:24X)),
IFTHEN=(WHEN=(112,1,PD,EQ,4),OVERLAY=(88:12X))
Back to top
View user's profile Send private message
useit

Active User


Joined: 05 Oct 2006
Posts: 152

PostPosted: Tue Dec 21, 2010 5:19 pm
Reply with quote

skolusu,
i got the reason:). its working fine now:) thank you so much
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Tue Dec 21, 2010 10:37 pm
Reply with quote

useit wrote:
hi,
one more similar exam i tried to execute it.but it failed with soc7.
input lrecl=205, output lrecl=99


Woah all these questions are part of an exam and you are getting the answers from here? What happens if the instructor asks you to explain the job?
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Tue Dec 21, 2010 11:53 pm
Reply with quote

Kolusu,

You're always available for the explanation icon_lol.gif
Back to top
View user's profile Send private message
useit

Active User


Joined: 05 Oct 2006
Posts: 152

PostPosted: Wed Dec 22, 2010 1:28 pm
Reply with quote

skolusu,
one more similar exam i tried to execute it.(it should hold 9 occurences instead of 3)

input lrecl=205, output lrecl=147

1-39 key data.

it is working fine. but in case of overflow value 0 is getting populated instead of spce/low values.

how to handle this condition?
Back to top
View user's profile Send private message
useit

Active User


Joined: 05 Oct 2006
Posts: 152

PostPosted: Wed Dec 22, 2010 3:48 pm
Reply with quote

skolusu,
please explain me once how it will append the records.

you have used group id, seq number, and also in 81st position 'A, B, C, D, E". give me a brief overview when you are free
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Wed Dec 22, 2010 4:13 pm
Reply with quote

Pushing skolusu?

Maybe he is in a different time zone, and doing his beauty sleep.
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 792
Location: Pennsylvania

PostPosted: Wed Dec 22, 2010 6:32 pm
Reply with quote

Who keeps the record books on the forum?

This thread is up to 47 replies.

Useit has changed the requirements half a dozen times.

He must be charmed.

I can believe this thread is still alive.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Wed Dec 22, 2010 7:01 pm
Reply with quote

Dave,

useit is one of those people letting do HIS work by other people.
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 792
Location: Pennsylvania

PostPosted: Wed Dec 22, 2010 7:07 pm
Reply with quote

I know, that is why I say he must be charmed.

He has been able to keep this post going for a long time.

You would think he has learned enough to carry on solo by now.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Wed Dec 22, 2010 9:26 pm
Reply with quote

Or understood that there has been more than enough spoon-feeding . . .

Imagine when it is no longer just class exercises (which should be in our Student/Fresher forum) but some employer expects some real work to be done. . . Do we see "urgent" on the horizon. . . icon_neutral.gif

d
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Thu Dec 23, 2010 1:09 am
Reply with quote

useit,

I am not going to spoon feed you any more. If all of these exercises are part of an exam, I suggest you study and try to answer them on your own. If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

Use [URL] BBCode for External Links
Back to top
View user's profile Send private message
useit

Active User


Joined: 05 Oct 2006
Posts: 152

PostPosted: Thu Dec 23, 2010 11:59 am
Reply with quote

skolusu i read dfsort getting started and tried various example. was trying the similar requirement for 15 occurences that time i got 0 instead of low values(for remaining space).so i asked you guys.dont misunderstand me.am seriously working hard on this.we can learn something from everyone.icon_smile.gif

in the below statement can you tell me (60,12) what value will it store?

OVERLAY=(36:60,12,81:C'A')

and also 72, 1 in below statement.


IFTHEN=(WHEN=(72,1,PD,EQ,1),OVERLAY=(36:24X) .

sorry for bothering you.am very thankful to u.
Back to top
View user's profile Send private message
useit

Active User


Joined: 05 Oct 2006
Posts: 152

PostPosted: Fri Dec 24, 2010 4:12 pm
Reply with quote

skolusu,
please answer the above question.will not trouble you now on.
regds,
useit
Back to top
View user's profile Send private message
useit

Active User


Joined: 05 Oct 2006
Posts: 152

PostPosted: Fri Dec 24, 2010 5:45 pm
Reply with quote

skolusu,

another example i was trying.i got the results correct but in case of overflow value zero is getting populated instead of space/low values.

input recl=205,output lrecl=219,keydata-1-39
maximum 30 "y" type under each "x" type record.
15 occurences.

below is the jcl i have written.let me know where i have done mistake

//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=INPUT.FILE,DISP=SHR
//SORTOUT DD DSN=.OUTPUT.FILE,DISP=SHR
//SYSIN DD *
INREC IFTHEN=(WHEN=INIT,BUILD=(1,39,45X'0000000C',40,12,X'1C')),
IFTHEN=(WHEN=GROUP,BEGIN=(39,1,CH,EQ,C'X'),
PUSH=(233:ID=8,242:SEQ=2)),
IFTHEN=(WHEN=(242,2,ZD,EQ,02),OVERLAY=(40:220,12,241:C'A')),
IFTHEN=(WHEN=(242,2,ZD,EQ,03),OVERLAY=(52:220,12,241:C'A')),
IFTHEN=(WHEN=(242,2,ZD,EQ,04),OVERLAY=(64:220,12,241:C'A')),
IFTHEN=(WHEN=(242,2,ZD,EQ,05),OVERLAY=(76:220,12,241:C'A')),
IFTHEN=(WHEN=(242,2,ZD,EQ,06),OVERLAY=(88:220,12,241:C'A')),
IFTHEN=(WHEN=(242,2,ZD,EQ,07),OVERLAY=(100:220,12,241:C'A')),
IFTHEN=(WHEN=(242,2,ZD,EQ,08),OVERLAY=(112:220,12,241:C'A')),
IFTHEN=(WHEN=(242,2,ZD,EQ,09),OVERLAY=(124:220,12,241:C'A')),
IFTHEN=(WHEN=(242,2,ZD,EQ,10),OVERLAY=(136:220,12,241:C'A')),
IFTHEN=(WHEN=(242,2,ZD,EQ,11),OVERLAY=(148:220,12,241:C'A')),
IFTHEN=(WHEN=(242,2,ZD,EQ,12),OVERLAY=(160:220,12,241:C'A')),
IFTHEN=(WHEN=(242,2,ZD,EQ,13),OVERLAY=(172:220,12,241:C'A')),
IFTHEN=(WHEN=(242,2,ZD,EQ,14),OVERLAY=(184:220,12,241:C'A')),
IFTHEN=(WHEN=(242,2,ZD,EQ,15),OVERLAY=(196:220,12,241:C'A')),
IFTHEN=(WHEN=(242,2,ZD,EQ,16),OVERLAY=(208:220,12,241:C'A')),

IFTHEN=(WHEN=(242,2,ZD,EQ,17),OVERLAY=(39X,220,12,241:C'B')),
IFTHEN=(WHEN=(242,2,ZD,EQ,18),OVERLAY=(39X,52:220,12,241:C'B')),
IFTHEN=(WHEN=(242,2,ZD,EQ,19),OVERLAY=(39X,64:220,12,241:C'B')),
IFTHEN=(WHEN=(242,2,ZD,EQ,20),OVERLAY=(39X,76,12,241:C'B')),
IFTHEN=(WHEN=(242,2,ZD,EQ,21),OVERLAY=(39X,88:220,12,241:C'B')),
IFTHEN=(WHEN=(242,2,ZD,EQ,22),OVERLAY=(39X,100:220,12,241:C'B')),
IFTHEN=(WHEN=(242,2,ZD,EQ,23),OVERLAY=(39X,112,12,241:C'B')),
IFTHEN=(WHEN=(242,2,ZD,EQ,24),OVERLAY=(39X,124:220,12,241:C'B')),
IFTHEN=(WHEN=(242,2,ZD,EQ,25),OVERLAY=(39X,136:220,12,241:C'B')),
IFTHEN=(WHEN=(242,2,ZD,EQ,26),OVERLAY=(39X,148,12,241:C'B')),
IFTHEN=(WHEN=(242,2,ZD,EQ,27),OVERLAY=(39X,160:220,12,241:C'B')),
IFTHEN=(WHEN=(242,2,ZD,EQ,28),OVERLAY=(39X,172:220,12,241:C'B')),
IFTHEN=(WHEN=(242,2,ZD,EQ,29),OVERLAY=(39X,184,12,241:C'B')),
IFTHEN=(WHEN=(242,2,ZD,EQ,30),OVERLAY=(39X,196:220,12,241:C'B')),
IFTHEN=(WHEN=(242,2,ZD,EQ,31),OVERLAY=(39X,208:220,12,241:C'B'))

SORT FIELDS=(233,9,CH,A),EQUALS

SUM FIELDS=(40,4,44,4,48,4,52,4,56,4,60,4,64,4,68,4,72,4,
76,4,80,4,84,4,88,4,92,4,96,4,100,4,104,4,108,4,
112,4,116,4,120,4,124,4,128,4,132,4,136,4,140,4,144,4,
148,4,152,4,156,4,160,4,164,4,168,4,172,4,176,4,180,4,
184,4,188,4,192,4,196,4,200,4,204,4,208,4,212,4,216,4,
231,1),FORMAT=PD

OUTREC IFOUTLEN=219,
IFTHEN=(WHEN=(39,2,CH,EQ,C'X'),OVERLAY=(40:179X)),
IFTHEN=(WHEN=(231,2,PD,EQ,01),OVERLAY=(52:167X)),
IFTHEN=(WHEN=(231,2,PD,EQ,02),OVERLAY=(64:155X)),
IFTHEN=(WHEN=(231,2,PD,EQ,03),OVERLAY=(76:143X)),
IFTHEN=(WHEN=(231,2,PD,EQ,04),OVERLAY=(88:131X)),
IFTHEN=(WHEN=(231,2,PD,EQ,05),OVERLAY=(100:119X)),
IFTHEN=(WHEN=(231,2,PD,EQ,06),OVERLAY=(112:107X)),
IFTHEN=(WHEN=(231,2,PD,EQ,07),OVERLAY=(124:95X)),
IFTHEN=(WHEN=(231,2,PD,EQ,08),OVERLAY=(136:83X)),
IFTHEN=(WHEN=(231,2,PD,EQ,09),OVERLAY=(148:71X)),
IFTHEN=(WHEN=(231,2,PD,EQ,10),OVERLAY=(160:59X)),
IFTHEN=(WHEN=(231,2,PD,EQ,11),OVERLAY=(172:47X)),
IFTHEN=(WHEN=(231,2,PD,EQ,12),OVERLAY=(184:35X)),
IFTHEN=(WHEN=(231,2,PD,EQ,13),OVERLAY=(196:23X)),
IFTHEN=(WHEN=(231,2,PD,EQ,14),OVERLAY=(208:11X))
/*
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Fri Dec 24, 2010 7:27 pm
Reply with quote

I think Skolusu got a stalker here.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Fri Dec 24, 2010 7:31 pm
Reply with quote

I guess the the TS should change is id from useit to useSkolusu icon_biggrin.gif
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Fri Dec 24, 2010 7:33 pm
Reply with quote

What do you mean by that Enrico? icon_rolleyes.gif
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Fri Dec 24, 2010 7:53 pm
Reply with quote

Ok Peter,
You should know that I have a warped mind

just a bit of word play
useit ==> use it

well the ts is not using "it" is rather using "Skolusu" thence

useit==> use it ==> Use Skolusu ==> useSkolusu

cheers

enrico
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Sat Dec 25, 2010 4:55 am
Reply with quote

Hello,

I suspect "no more spoon feeding" was not understood. . .

Quote:
another example i was trying.i got the results correct but in case of overflow value zero is getting populated instead of space/low values.
Why does someone believe it appropriate to insert non-numeric values in a numeric field. . .

If you need this quickly, suggest you go ahead and write a small program to do the work.

For your future, you should only provide solutions to ypur employer/client that you actually understand. What happens when there is a sudden requirement change for a critical Production run and you have to tell "them" that you didn't write it and don't really understand how it works.
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 -> DFSORT/ICETOOL Goto page Previous  1, 2, 3  Next

 


Similar Topics
Topic Forum Replies
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts DFsort help with SUM() DFSORT/ICETOOL 12
Search our Forums:

Back to Top