On 8/14/06, mfstudy group <nor...@googlegroups.com> wrote:
>
> MFSTUDY
> http://groups.google.com/group/mfstudy
>
> mfs...@googlegroups.com
>
> Today's topics:
>
> * Sort Members from PDS using REXX - 1 messages, 1 author
> http://groups.google.com/group/mfstudy/browse_thread/thread/ce111e9bd9b2555b
> * How to test whether the given data set is empty or not - 2 messages, 2
> authors
> http://groups.google.com/group/mfstudy/browse_thread/thread/5e106e2e0393f2d
>
> ==============================================================================
> TOPIC: Sort Members from PDS using REXX
> http://groups.google.com/group/mfstudy/browse_thread/thread/ce111e9bd9b2555b
> ==============================================================================
>
> == 1 of 1 ==
> Date: Tues, Aug 8 2006 6:18pm
> From: "Mridul"
>
>
> Hi All,
>
> I have written a REXX program to address the particular issue:
>
> I have a flat file which has 2 rows. First row contains the number of
> members in a PDS and the second contains the name of that particular
> PDS.My REXX code reads the flat file. It will first check the validity
> of the input PDS using LISTCAT. Then it allocates two different PDS's
> (one for COBOL Programs and the other for copbooks) using the same
> attribute as the input PDS received from the flat file.It will then get
> the list of members in the PDS. If the name starts with 'FWG0' it will
> put these members in the copy library else it will put them in the
> cobol program library.
>
> The Rexx is causing problem at 2 places :
> 1: When executing this portion of the code
>
> CALL OUTTRAP "TRAP."
> "LISTD'"||PDSNAME||"'MEMBERS"
> CALL OUTTRAP "OFF"
> it gives the following problem:
>
> 33 *-* "LISTD'"||PDSNAME||"'MEMBERS"
> +++ RC(-3) +++
>
> 2: When the following code is uncommented out and executed
>
> /* "ALLOC F(MYINDD) DS('"DSNAME"("X")') SHR REUSE"
> "ALLOC F(MYOUTDD) DS('"PDSNAMECPY"("X")') SHR REUSE"
> "EXECIO * DISKR MYINDD (FINIS"
> "EXECIO * DISKW MYOUTDD (FINIS"
> "FREE F(MYINDD) F(MYOUTDD)" */
> it gives the following problem:
>
> 57 +++ "ALLOC F(MYINDD) DS('"DSNAME"("X
> 4 +++ PDSNAME = STRIP(INPUT.2)
> Error running GO, line 57: Invalid hexadecimal or binary string
>
> The complete REXX Code is copied below:
>
> /* REXX */
> "EXECIO * DISKR INFILE(STEM INPUT."
> PDSNAME = STRIP(INPUT.2)
> CALL OUTTRAP "LISTC."
> "LISTCAT ENTRIES('"PDSNAME"')"
> IF RC \= 0 THEN DO
> SAY "ERROR: DATA SET DOES NOT EXIST"
> EXIT 12
> END
> CALL OUTTRAP "OFF"
> PDSNAMEPGM = SUBSTR(PDSNAME,1,20)||'.COBOLSOR'
> PDSNAMECPY = SUBSTR(PDSNAME,1,20)||'.COPYLIB'
> "ALLOCATE DA('"PDSNAMEPGM"') LIKE('"PDSNAME"') NEW"
> IF RC > 0 THEN DO
> SAY "ERROR: FAILURE TO ALLOCATE DATASET" PDSNAMEPGM
> EXIT 8
> END
> "ALLOCATE DA('"PDSNAMECPY"') LIKE('"PDSNAME"') NEW"
> IF RC > 0 THEN DO
> SAY "ERROR: FAILURE TO ALLOCATE DATASET" PDSNAMECPY
> EXIT 8
> END
> CALL OUTTRAP "TRAP."
> "LISTD'"||PDSNAME||"'MEMBERS"
> CALL OUTTRAP "OFF"
> I = 1
> MEM_FOUND = "FALSE"
> DO UNTIL MEM_FOUND = "TRUE"
> SAY TRAP.I
> IF TRAP.I = "--MEMBERS--" THEN DO
> I = I + 1
> MEM_FOUND = "TRUE"
> END
> ELSE DO
> I = I + 1
> END
> END
> J = 0
> DO UNTIL I = TRAP.0
> IF SUBSTR(STRIP(TRAP.I),1,4) = 'FWG0' THEN DO
> X = STRIP(TRAP.I)
> /* "ALLOC F(MYINDD) DS('"DSNAME"("X")') SHR REUSE"
> "ALLOC F(MYOUTDD) DS('"PDSNAMECPY"("X")') SHR REUSE"
> "EXECIO * DISKR MYINDD (FINIS"
> "EXECIO * DISKW MYOUTDD (FINIS"
> "FREE F(MYINDD) F(MYOUTDD)" */
> END
> ELSE DO
> X = STRIP( TRAP.I)
> /* "ALLOC F(MYINDD) DS('"DSNAME"("X")') SHR REUSE"
> "ALLOC F(MYOUTDD) DS('"PDSNAMEPGM"("X")') SHR REUSE"
> "EXECIO * DISKR MYINDD (FINIS"
> "EXECIO * DISKW MYOUTDD (FINIS"
> "FREE F(MYINDD) F(MYOUTDD)" */
> END
> I = I + 1
> J = J + 1
> END
> IF J = INPUT.1 THEN DO
> SAY 'SUCCESS'
> END
> ELSE DO
> SAY "ERROR: INCONSISTENT DATA MOVEMENT"
> EXIT 12
> END
>
>
>
>
>
>
> ==============================================================================
> TOPIC: How to test whether the given data set is empty or not
> http://groups.google.com/group/mfstudy/browse_thread/thread/5e106e2e0393f2d
> ==============================================================================
>
> == 1 of 2 ==
> Date: Sat, Aug 12 2006 7:28am
> From: sivakum...@gmail.com
>
>
> Hi frnds,
>
> How ru , I am Siva Kumar just completed Mainframes course and i have
> doubt that how test the given data set is empty or not thru JCL
>
> Thanks if u can help me
>
> Regards,
>
> siva
>
>
>
>
>
> == 2 of 2 ==
> Date: Sun, Aug 13 2006 7:12pm
> From: rayapureddy sudhir
>
>
> Hi siva,
>
> Using this code, you can only
>
> //*
> //STEP10 EXEC PGM=CTEMPTDS,
> // COND=(4,LT)
> //*
> //SYSUT1 DD DSN=ABC.ABCD.ABCD.t1,DISP=SHR
> //* ABC.ABCD.ABCD.T1 is the file
> // IF NOT ( STEP10.RC = 4000 ) THEN
> //* The jcl code to be executed after this
> //*
> //*
> //*
> // ENDIF
>
> Have a Nice day
>
> bye,
> Sudhir R
>
>
> --- sivakum...@gmail.com wrote:
>
> >
> > Hi frnds,
> >
> > How ru , I am Siva Kumar just completed Mainframes
> > course and i have
> > doubt that how test the given data set is empty or
> > not thru JCL
> >
> > Thanks if u can help me
> >
> > Regards,
> >
> > siva
> >
> >
> >
> >
> >
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
>
>
>
> ==============================================================================
>
> You received this message because you are subscribed to the Google Groups "MFSTUDY"
> group.
>
> To post to this group, send email to mfs...@googlegroups.com or visit http://groups.google.com/group/mfstudy
>
> To unsubscribe from this group, send email to mfstudy-u...@googlegroups.com
>
> To change the way you get mail from this group, visit:
> http://groups.google.com/group/mfstudy/subscribe
>
> To report abuse, send email explaining the problem to ab...@googlegroups.com
>
> ==============================================================================
> Google Groups: http://groups.google.com
>