DATA Step, Macro, Functions and more

FILEVAR and Physical name

Reply
Occasional Contributor
Posts: 13

FILEVAR and Physical name

Greetings.

We're running SAS 9.1 and I'm having problems with FILEVAR=. I'm trying to PUT to dfferent members in the same PDSE and I've specified the following FILE-statement: FILE PROCINP FILEVAR=DSSSTMT; that's executed in a loop. Every pass thru the loop writes to a different member. At the start of every pass I generate a different membername (common prefix, variable suffix).

When this statement executes variable DSSSTMT contains the string 'Z537815.ISPF.DATA(DSSDFRG1)' (first pass) and SAS comes back with ERROR: INVALID PHYSICAL NAME. Why? I cannot specify pds(member) in FILEVAR?

Thanks for any info.

Willem Vermeer
ING, the Netherlands.
Super Contributor
Super Contributor
Posts: 3,174

Re: FILEVAR and Physical name

Posted in reply to Willempie
Please post the SAS log information with the exact error message and SAS program code revealed. If you are using macro or macro variable logic, you will want to have an OPTIONS, such as:

OPTIONS SOURCE SOURCE2 MACROGEN SYMBOLGEN MLOGIC;

It's quite possible that with the above SAS statement, you may see the error cause with your own problem diagnosis, by the way. One possibility to verify is the DCB attributes for your PDSE, ensuring that it is being allocated as you expect? And obviously a member name can only be up to 8 characters.

Scott Barry
SBBWorks, Inc.
Occasional Contributor
Posts: 13

Re: FILEVAR and Physical name

For what it's worth...

NOTE: COPYRIGHT (C) 2002-2003 BY SAS INSTITUTE INC., CARY, NC, USA.
NOTE: SAS (R) 9.1 (TS1M3)
LICENSED TO ING BANK N.V., SITE 0002578023.
NOTE: THIS SESSION IS EXECUTING ON THE Z/OS V01R09M00 PLATFORM.

NOTE: RUNNING ON IBM MODEL 2094 SERIAL NUMBER 0D23C0,
IBM MODEL 2094 SERIAL NUMBER 0D23C0.


NOTE: SAS 9.1.3 SERVICE PACK 4

------------------------------------------------------------------
** ING - SAS VERSION 9.1 T001 **
------------------------------------------------------------------
** FOR MORE INFORMATION ABOUT SAS SYSTEM SOFTWARE PLEASE **
** REFER TO THE ING SAS PORTAL HTTP://SAS.EUROPE.INTRANET **
** THERE YOU WILL ALSO FIND A LINK TO THE ONLINE DOCUMENTATION **
** OF SAS V9 **
** HANDLEIDINGEN, NEWS, PDF-FILES I:\SAS\SAS#BHR\DOC **
** **
** OPS&ITB/DCO/PO/MW&D/TEAM 1 **
------------------------------------------------------------------


NOTE: THE SASUSER LIBRARY WAS NOT SPECIFIED. SASUSER LIBRARY WILL NOW BE THE SAM
NOTE: ALL DATA SETS AND CATALOGS IN THE SASUSER LIBRARY WILL BE DELETED AT THE E
PREVENT THEIR DELETION.

NOTE: SAS SYSTEM OPTIONS SPECIFIED ARE:
SORT=4 SYSPARM=(IMAGE=T0)

NOTE: 33554432 BYTES WERE AVAILABLE ABOVE THE LINE AT INITIALIZATION.

NOTE: 6356992 BYTES WERE AVAILABLE BELOW THE LINE AT INITIALIZATION.

NOTE: 33030144 BYTES WERE AVAILABLE ABOVE THE LINE AFTER ADJUSTMENT FOR MEMLEAVE
NOTE: THE INITIALIZATION PHASE USED 0.02 CPU SECONDS AND 12741K.

NOTE: THE ADDRESS SPACE HAS USED A MAXIMUM OF 624K BELOW THE LINE AND 13776K ABO

1 *--------------------------------------------------------------------
2 |
3 | NAME - PRZ5481A
4 |
5 | FUNCTION -
6 | UITGAANDE VAN EEN VOLDATA DCOLLECT WORDT ER EEN TOP-5
7 | BEPAALD VAN VOLUMES MET DE GROOTSTE FRAGMENTATIONINDEX.
8 | VOOR DEZE VOLUMES WORDT ER EEN DEFRAG GEGENEREERD.
9 |
10 | INPUT -
11 | EEN VOLDATA DCOLLECT.
12 |
2 THE SAS SYSTEM

13 | OUTPUT -
14 | VOOR ELK GESELECTEERD VOLUME WORDT HET VOLGENDE GEMAAKT:
15 | 1. DSSDFRGX - DFDSS-DEFRAG STATEMENT.
16 | 2. DSFVOLX - DD-STMT OM VOOR ICKDSF VOLUME TE ALLOCEREN
17 |
18 | BEIDEN WORDEN GEBRUIKT IN DE VERVOLGJOB.
19 |
20 |
21 | CHANGE HISTORY -
22 | 04-03-2009-WV GESCHREVEN.
23 |
24 | AUTHOR -
25 | A.W. VERMEER - OIB/TS/ISS/D&SM/SM1 - EXT. 37313
26 |
27 *--------------------------------------------------------------------
28 *--------------------------------------------------------------------
29 | EXTRACT VOLUME-STATS FROM DCOLLECT.
30 *--------------------------------------------------------------------
31 %INCLUDE DSNSRC(DCOL);
585 *--------------------------------------------------------------------
586 | INITIALIZATION.
587 *--------------------------------------------------------------------
588 OPTIONS MLOGIC MLOGICNEST MPRINT MPRINTNEST SOURCE SOURCE2
589 MACROGEN SYMBOLGEN;

NOTE: THE INFILE DCOLLECT IS:
DSNAME=SYS09082.T103344.RA000.Z537815D.DCOL.H01,
UNIT=3390,VOLUME=T0W003,DISP=OLD,BLKSIZE=27998,
LRECL=4096,RECFM=VB

NOTE: 176 RECORDS WERE READ FROM THE INFILE DCOLLECT.
THE MINIMUM RECORD LENGTH WAS 136.
THE MAXIMUM RECORD LENGTH WAS 136.
NOTE: THE DATA SET WORK.VOLUMES HAS 176 OBSERVATIONS AND 24 VARIABLES.
NOTE: THE DATA SET WORK.DATASETS HAS 0 OBSERVATIONS AND 44 VARIABLES.
NOTE: THE DATA STATEMENT USED 0.06 CPU SECONDS AND 14809K.

NOTE: THE ADDRESS SPACE HAS USED A MAXIMUM OF 624K BELOW THE LINE AND 15872K ABO


590 DATA CANDIDATES (KEEP=VOLSER FRAGINDX PCTFREE);
591 SET VOLUMES;
592
593 *--------------------------------------------------------------------
594 | GET IMAGECODE.
595 *--------------------------------------------------------------------
596 IF _N_ = 1
597 THEN DO;
598 IMGINDX = INDEX(SYSPARM(),'IMAGE=');
599 IF IMGINDX = 0
600 THEN ABORT ABEND 900;
601 IMAGE = SUBSTR(SYSPARM(),(IMGINDX+6),2);
602 END;
3 THE SAS SYSTEM

603
604 *--------------------------------------------------------------------
605 | EXCLUDE VOLUMES THAT CANNOT BE DEFRAGGED.
606 *--------------------------------------------------------------------
607 IF VOLSER ¬=: STRIP(IMAGE)||'HSM'
608 AND VOLSER ¬=: STRIP(IMAGE)||'W'
609 AND VOLSER ¬=: '-'
610 ;
611
612 *--------------------------------------------------------------------
613 | SORT ALL VOLUMES ON DESC FRAGINDX / DESC PCTFREE.
614 *--------------------------------------------------------------------

NOTE: THERE WERE 176 OBSERVATIONS READ FROM THE DATA SET WORK.VOLUMES.
NOTE: THE DATA SET WORK.CANDIDATES HAS 150 OBSERVATIONS AND 3 VARIABLES.
NOTE: THE DATA STATEMENT USED 0.00 CPU SECONDS AND 14855K.

NOTE: THE ADDRESS SPACE HAS USED A MAXIMUM OF 624K BELOW THE LINE AND 15920K ABO


615 PROC SORT DATA=CANDIDATES NODUPKEY;
616 BY DESCENDING FRAGINDX
617 DESCENDING PCTFREE
618 ;
619
620 *--------------------------------------------------------------------
621 | SELECT TOP-5 VOLUMES FOR DEFRAG.
622 *--------------------------------------------------------------------

NOTE: THERE WERE 150 OBSERVATIONS READ FROM THE DATA SET WORK.CANDIDATES.
NOTE: 17 OBSERVATIONS WITH DUPLICATE KEY VALUES WERE DELETED.
NOTE: THE DATA SET WORK.CANDIDATES HAS 133 OBSERVATIONS AND 3 VARIABLES.
NOTE: THE PROCEDURE SORT USED 0.00 CPU SECONDS AND 15085K.

NOTE: THE ADDRESS SPACE HAS USED A MAXIMUM OF 624K BELOW THE LINE AND 16160K ABO


623 PROC APPEND BASE=DEFRAG DATA=CANDIDATES (OBS=5);
624
625 *--------------------------------------------------------------------
626 | GENERATE FOR EACH VOLUME DEFRAG- + VOLUME-DD MEMBERS.
627 *--------------------------------------------------------------------

NOTE: APPENDING WORK.CANDIDATES TO WORK.DEFRAG.
NOTE: BASE DATA SET DOES NOT EXIST. DATA FILE IS BEING COPIED TO BASE FILE.
NOTE: THERE WERE 5 OBSERVATIONS READ FROM THE DATA SET WORK.CANDIDATES.
NOTE: THE DATA SET WORK.DEFRAG HAS 5 OBSERVATIONS AND 3 VARIABLES.
NOTE: THE PROCEDURE APPEND USED 0.01 CPU SECONDS AND 15462K.

NOTE: THE ADDRESS SPACE HAS USED A MAXIMUM OF 624K BELOW THE LINE AND 16544K ABO


628 DATA _NULL_;
4 THE SAS SYSTEM

629 SET DEFRAG;
630 ;
631 RETAIN BK -1
632 CNT 0
633 ;
634 LENGTH DSSSTMT
635 DSFDDN $60;
636
637 DO CNT = 1 TO 5;
638 DSSMBR = 'DSSDFRG'||PUT(CNT,1.);
639 DSFMBR = 'DSFVOL'||PUT(CNT,1.);
640
641 DSSSTMT= COMPRESS("'Z537815.ISPF.DATA("||DSSMBR||")'",' ');
642 FILE PROCINP FILEVAR=DSSSTMT LRECL=80;
643 PUT @005 "DEFRAG DYNAM(" VOLSER +BK ") -" /
644 @005 " FRAGI(000) -" /
645 @005 " ADMIN"
646 ;
647
648 DSFDDN = COMPRESS("'Z537815.ISPF.DATA("||DSFMBR||")'",' ');
649 FILE PROCINP FILEVAR=DSFDDN LRECL=80;
650 PUT @001 '//DISK DD UNIT=SYSDA,VOL=SER=' VOLSER +BK ',DISP=OLD';
651 END;

ERROR: INVALID PHYSICAL NAME.
ERROR: INVALID PHYSICAL NAME.
ERROR: INVALID PHYSICAL NAME.
VOLSER=T0P008 FRAGINDX=497 PCTFREE=32 BK=-1 CNT=1 DSSSTMT='Z537815.ISPF.DATA(DSSDFRG1)' DSFDDN=
_ERROR_=1 _N_=1
NOTE: THE SAS SYSTEM STOPPED PROCESSING THIS STEP BECAUSE OF ERRORS.
NOTE: THERE WERE 1 OBSERVATIONS READ FROM THE DATA SET WORK.DEFRAG.
NOTE: THE DATA STATEMENT USED 0.00 CPU SECONDS AND 15462K.
NOTE: THE ADDRESS SPACE HAS USED A MAXIMUM OF 624K BELOW THE LINE AND 16544K ABO


ERROR: ERRORS PRINTED ON PAGE 4.
ERROR: ERRORS PRINTED ON PAGE 4.
ERROR: ERRORS PRINTED ON PAGE 4.

NOTE: THE SAS SESSION USED 0.12 CPU SECONDS AND 15462K.

NOTE: THE ADDRESS SPACE HAS USED A MAXIMUM OF 624K BELOW THE LINE AND 16544K ABO

NOTE: SAS INSTITUTE INC., SAS CAMPUS DRIVE, CARY, NC USA 27513-2414

I hope it's readable...

Willem Vermeer
ING, the Netherlands
N/A
Posts: 0

Re: FILEVAR and Physical name

Posted in reply to Willempie
Is it not your second filevar that is causing the error? It has no value.

ERROR: INVALID PHYSICAL NAME.
VOLSER=T0P008 FRAGINDX=497 PCTFREE=32 BK=-1 CNT=1 DSSSTMT='Z537815.ISPF.DATA(DSSDFRG1)' DSFDDN=
_ERROR_=1 _N_=1

DSFDDN has no value assigned to it when the filevar executes. Or am I missing something here?
Occasional Contributor
Posts: 13

Re: FILEVAR and Physical name

Posted in reply to deleted_user
Hmmmm.... anything's possible. But I have always thought that, given the fact that SAS seemed to get into problems just after it had set the vars for the first FILEVAR, the problem was with this 1st FILEVAR.

After all, if the problem had been with the 2nd FILEVAR, shouldn't SAS then at least have filled in DSFddn? I cannot see how it could have skipped the setting of DSFddn. True, if it DID skip setting DSFddn, then the 2nd FILEVAR would indeed contain an invalid physical filename.

Willem Vermeer
ING, the Netherlands
N/A
Posts: 0

Re: FILEVAR and Physical name

Posted in reply to Willempie
Yes, looking more at it, I tend to agree with you. It has just aborted as soon as the invlaid file name is encountered, i.e. before the second filevar is set.

Worth trying just hard coding in the file name to see if that works? If it does then you can suspect it is more of a SAS issue, if not then it literally is an invalid file name.
Occasional Contributor
Posts: 13

Re: FILEVAR and Physical name

Posted in reply to deleted_user
Hurrah!!! I got it working! I discovered 2 errors: [1] erroneous loop with CNT (removed it) and [2] the 2 different FILEVAR-variables. After re-arranging the code a bit, it all finally works:

639 CNT = CNT + 1;
640 DSSMBR = 'DSSDFRG'||PUT(CNT,1.);
641 DSFMBR = 'DSFVOL'||PUT(CNT,1.);
642
643 DSSSTMT= COMPRESS("'Z537815.ISPF.DATA("||DSSMBR||")'",' ');
644 DSFDDN = COMPRESS("'Z537815.ISPF.DATA("||DSFMBR||")'",' ');
645
646 STMT = DSSSTMT;
647 FILE PROCINP FILEVAR=STMT LRECL=80;
648 PUT @005 "DEFRAG DYNAM(" VOLSER +BK ") -" /
649 @005 " FRAGI(000) -" /
650 @005 " ADMIN "
651 ;
652
653 STMT = DSFDDN;
654 FILE PROCINP FILEVAR=STMT LRECL=80;
655 PUT @001 '//DISK DD UNIT=SYSDA,VOL=SER=' VOLSER +BK ',DISP=OLD';

Thanks for all your comments!

Willem Vermeer
ING, the Netherlands
Super Contributor
Super Contributor
Posts: 3,174

Re: FILEVAR and Physical name

Posted in reply to Willempie
Off-topic: do consider that DEFRAGs these days in z/OS, other than increasing first-extent sizes, is pretty much unnecessary, what with DFSMS and 3rd party software like STOPX37. Also, I would encourage you to code a higher FRAGI parameter to cut-back on the number of excessive defrags that re-claim even 1 extent.

Scott Barry
SBBWorks, Inc.
Ask a Question
Discussion stats
  • 7 replies
  • 441 views
  • 0 likes
  • 3 in conversation