MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Sorting Detail records
Goto page Previous  1, 2, 3, 4
 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
nguyenh
Beginner


Joined: 09 Mar 2004
Posts: 52
Topics: 6

PostPosted: Fri Jan 14, 2005 8:11 pm    Post subject: Reply with quote

Kolusu
Code:

I am lost here ! what is the language you are referring to ?


Smile
I am using JCL. Please forgive me! I am very poor in mainframe skill as you had already seen Smile

I am trying to call 1 skeleton (called skleton B) from another skeleton (skeleton A), I pass 2 variables &DSN1 and &DSN2 to skelton B, in skeleton B, I wanta check to see if &DSN1=1 or 2 and &DSN2="oldlist" or "newlist". I know the syntax i posted in the previous post is not correct. That is just some kinda psuedo code for you to see. Smile

my question is how can put that statement in form of JCL.

If ( (condition1 or condition2) and (condition3 or condition4) )
I tried this but it didn't seem to work:
Code:

//   IF ( (&DSN1 = 1 |  &DSN1 = 2) & (&DSN2 = OLDLIST | &DSN2 = NEWLIST ) ) THEN
// statement...............
//   ENDIF
Back to top
View user's profile Send private message
nguyenh
Beginner


Joined: 09 Mar 2004
Posts: 52
Topics: 6

PostPosted: Fri Jan 14, 2005 8:13 pm    Post subject: Reply with quote

Also how do I expand the if statement more than 2 lines ?

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


Joined: 09 Mar 2004
Posts: 52
Topics: 6

PostPosted: Mon Jan 24, 2005 5:26 pm    Post subject: Reply with quote

Hi all,
Which all the helps you provided, I got the skeleton works as desired.
Below is a working skeleton, I am wondering if there is a cleaner, shorter way that provides the same result? just for your reference the DSN1 contains 1, or 2 and DSN2 contains "NEWOUTLIST", or "OLDOUTLIST"
you should not worry about those variables. Thank you much!

Code:

//**********************************************************************
//*RUN ICETOOL UTILITY TO CONSTRUCT SORT KEYS THEN SORT THE RECORDS
//**********************************************************************
//SORT&DSN1   EXEC PGM=ICETOOL,REGION=512K
//DFSMSG   DD SYSOUT=*
//TOOLMSG  DD SYSOUT=*
//IPFILE   DD DSN=&USERID..TEMP&DSN1,DISP=SHR
//OPFILE   DD DSN=&USERID..&DSN2,DISP=(OLD,KEEP)
//HEADER   DD DSN=&&HEADER,
//            DISP=(NEW,PASS),SPACE=(CYL,(10,20),RLSE)
//DETAIL   DD DSN=&&DETAIL,
//            DISP=(NEW,PASS),SPACE=(CYL,(10,20),RLSE)
//COMBIN   DD DSN=*.HEADER,VOL=REF=*.HEADER,DISP=OLD
//         DD DSN=*.DETAIL,VOL=REF=*.DETAIL,DISP=OLD
//TEMP1    DD DSN=&&T1,
//            DISP=(NEW,PASS),SPACE=(CYL,(10,20),RLSE)
//TEMP2    DD DSN=&&T2,
//            DISP=(NEW,PASS),SPACE=(CYL,(10,20),RLSE)
//TEMP3    DD DSN=&&T3,
//            DISP=(NEW,PASS),SPACE=(CYL,(10,20),RLSE)
//TEMP4    DD DSN=&&T4,
//            DISP=(NEW,PASS),SPACE=(CYL,(10,20),RLSE)
//TEMP5    DD DSN=*.TEMP3,VOL=REF=*.TEMP3,DISP=OLD
//         DD DSN=*.TEMP4,VOL=REF=*.TEMP4,DISP=OLD
//TEMP6    DD DSN=&&T6,
//            DISP=(NEW,PASS),SPACE=(CYL,(10,20),RLSE)
//TEMP7    DD DSN=&&T7,
//            DISP=(NEW,PASS),SPACE=(CYL,(10,20),RLSE)
//TEMP8    DD DSN=&&T8,
//            DISP=(NEW,PASS),SPACE=(CYL,(10,20),RLSE)
//TEMP9    DD DSN=&&T9,
//            DISP=(NEW,PASS),SPACE=(CYL,(10,20),RLSE)
//TEMP10   DD DSN=&&T10,
//            DISP=(NEW,PASS),SPACE=(CYL,(10,20),RLSE)
//TEMP11   DD DSN=*.TEMP6,VOL=REF=*.TEMP6,DISP=OLD
//         DD DSN=*.TEMP7,VOL=REF=*.TEMP7,DISP=OLD
//         DD DSN=*.TEMP8,VOL=REF=*.TEMP8,DISP=OLD
//         DD DSN=*.TEMP9,VOL=REF=*.TEMP9,DISP=OLD
//         DD DSN=*.TEMP10,VOL=REF=*.TEMP10,DISP=OLD
//TOOLIN   DD *
   COUNT FROM(IPFILE)
   COPY FROM(IPFILE) USING(CTL1)
   COPY FROM(COMBIN) USING(CTL2)
   SPLICE FROM(TEMP1) TO(TEMP2) -
           ON(87,8,CH) -
           WITH(1,80) -
           WITHALL USING(CTL3)
   COPY FROM(TEMP2) USING(CTL4)
   COPY FROM(TEMP5) USING(CTL5)
   SORT FROM(TEMP11) USING(CTL6)

//CTL1CNTL DD *
   INREC  FIELDS=(1,80,SEQNUM,8,ZD)
   OUTFIL FNAMES=HEADER,
   INCLUDE=(1,1,CH,EQ,C'*'),
   OUTREC=(1,80,8C'0',SEQNUM,8,ZD,C'H',39,6)
   OUTFIL FNAMES=DETAIL,SAVE,
   OUTREC=(1,88,SEQNUM,8,ZD,C'Z',6X)

//CTL2CNTL DD *
   INREC  FIELDS=(1,96,(81,8,ZD,SUB,89,8,ZD),M11,LENGTH=8,97,7)
   OUTFIL FNAMES=TEMP1,
   OUTREC=(1,80,106,6,97,8,89,8)

//CTL3CNTL DD *
   OUTFIL FNAMES=TEMP2,
   OUTREC=(1,86,SEQNUM,7,ZD)

//CTL4CNTL DD *
   OUTFIL FNAMES=TEMP3,
   INCLUDE=(1,1,CH,EQ,C' ',OR,
             77,2,CH,EQ,C'TA',OR,
             77,2,CH,EQ,C'TB',OR,
             77,2,CH,EQ,C'TC'),
   OUTREC=(1,93,2,4,10X)
   OUTFIL FNAMES=TEMP4,SAVE,
   OUTREC=(1,93,1,10,4X)

//CTL5CNTL DD *
   OUTFIL FNAMES=TEMP6,
   INCLUDE=(77,2,CH,EQ,C'TT'),
   OUTREC=(1,103,11,4)

   OUTFIL FNAMES=TEMP7,
   INCLUDE=(77,2,CH,EQ,C'CA'),
   OUTREC=(1,103,73,4)

   OUTFIL FNAMES=TEMP8,
   INCLUDE=(77,2,CH,EQ,C'FM'),
   OUTREC=(1,103,4X)

   OUTFIL FNAMES=TEMP9,
   INCLUDE=(77,2,CH,EQ,C'DL'),
   OUTREC=(1,103,1,4)

   OUTFIL FNAMES=TEMP10,SAVE,
   OUTREC=(1,103,4X)

//CTL6CNTL DD *
   OPTION EQUALS
   INREC FIELDS=(1,107)
   SORT  FIELDS=(81,6,CH,A,
                 94,10,CH,A,
                 77,2,CH,A,
                 104,4,CH,A,
                 79,2,CH,A,
                 87,7,CH,A)
   OUTFIL FNAMES=OPFILE,
   OUTREC=(1,86)
/*

Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12368
Topics: 75
Location: San Jose

PostPosted: Tue Jan 25, 2005 9:59 am    Post subject: Reply with quote

nguyenh,

I briefly looked at your JCL. However I cannot suggest a better solution unless I know the requirements.

Please create a new topic with exact requirements and I will post a solution for it.

Make sure that you have the following details in the post.

1. LRECL, RECFM of input and output datasets.
2. Sample Input and desired output
3. Any conditions for including/omitting records

Kolusu
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Goto page Previous  1, 2, 3, 4
Page 4 of 4

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group