Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Example 2:

&pagelevel(4)&pagelevel

The procedure DO.LIB.CONTENTS lists all the elements contained in a library. The most important data for each element is written to a list. The conversion of the PRINT and DO commands in this procedure is subject to restrictions. SDF-CONV reports a NOTE for each of these commands. The PRINT command is not converted because its first operand is a procedure parameter; conversion of the DO command cannot be guaranteed due to the variety of context-dependent conversion possibilities. SDF-CONV enters conversion proposals for the DO commands in the output procedure.

Input procedure DO.LIB.CONTENTS

/PROC N,(&LIBNAME=,&LISTOUT=,&PRINT=,&INPUT),SUBDTA=&
/DCLJV #NEWIMAG
/SETJV #NEWIMAG,X'0C'
/WR-T '&(#NEWIMAG)'
/WR-T ' '
/WR-T ' '
/WR-T '*******************************************************'
/WR-T '****    Listing of elements stored in a library    ****'
/WR-T '*******************************************************'
/WR-T ' '
/WR-T 'Name of the library                           : LIBNAME'
/REMARK input &LIBNAME
/SYSFILE SYSOUT=*DUMMY
/FS &LIBNAME
/SYSFILE SYSOUT=()
/SKIP .LINK
/STEP  "Error with FSTATUS"
/SYSFILE SYSOUT=()
/WR-T ' '
/WR-T ' '
/WR-T 'Input error !'
/WR-T 'Library &LIBNAME does not exist/cannot be opened'
/SKIP .E
/.LINK REMARK Edit the library
/WR-T 'Name of the output list                       : LISTOUT'
/WR-T 'If the output list already exists                      '
/WR-T 'the data is added at the end of the file.              '
/WR-T 'Is the list to be printed (Y/N) ?             : PRINT  '
/REMARK Input &LISTOUT and &PRINT
/SETSW ON=(1)
/SYSFILE SYSDTA=(SYSCMD)
/SYSFILE SYSLST=(&LISTOUT,EXTEND)
/SYSFILE SYSOUT=*DUMMY
/FILE &LIBNAME,LINK=LIB001
/EXEC $LMS
PAR INFO=SUMMARY
PRT (LST)
LST* (1)
END
/STEP
/SYSFILE SYSOUT=()
/SYSFILE SYSLST=()
/SYSFILE SYSDTA=()
/SETSW OFF=(1)
/REL LIB001
/WR-T ' '
/WR-T ' '
/WR-T '**** Editing completed.'
/WR-T '**** The result is contained in the list &LISTOUT.'
/SKIP "Branch dependent on the PRINT variables" .&PRINT
/WR-T ' '
/.J REMARK Print the list
/PRINT &LISTOUT,PNAME=INF,ENDNO=2048
/WR-T 'List &LISTOUT being printed.'
/.N REMARK
/WR-T 'Edit another library or terminate the procedure ?'
/SKIP "Input: A (edit) or E (terminate)" .&INPUT
/.A REMARK Call the procedure again
/DO DO.LIB.CONTENTS
/STEP
/.E REMARK End
/WR-T ' '
/WR-T '**** Procedure terminated'
/ENDP

SDF-CONV run

/start-sdf-conv ———————————————————————————————————————————————————————  (1)
%  BLS0517 MODULE 'CVRMAIN' LOADED
%  CVR0001 SDF-CONV VERSION 'V03.0B80' STARTED
%  CVR0060 SDF-CONV VERSION 'V03.0B80' READY
//convert from-file=do.lib.contents,to-file=sdf.do.lib.contents,doc=*min (2)
%  CVR1000 CONVERSION TERMINATED WITH:
%  CVR1001            FAILURES:    0
%  CVR1002            ERRORS  :    0
%  CVR1003            WARNINGS:    0
%  CVR1004            NOTES   :    2
//end —————————————————————————————————————————————————————————————————  (3)
                                                                                                

(1)

The SDF-CONV utility routine is started.

(2)

The CONVERT statement assigns the input and output procedures, as well as defining the documentation level. All other operands of the CONVERT statement are given the default value. Once processing has been completed, SDF-CONV reports that conversion was terminated with two notes (NOTE). This overview is output to SYSOUT.

(3)

SDF-CONV is terminated with the END statement.

Conversion log (SYSLST)

       ***** BS2000 COMMAND  CONVERTER : SDF-CONV V3 *****         page 1
%  CVR1010 OPTIONS IN EFFECT: —————————————————————————————————————————  (1) 
%  CVR1011         FROM-FILE            = DO.LIB.CONTENTS
%  CVR1012         EXPECT-CONTINUATION  = *NEW-MODE
%  CVR1013         PARAMETER-LINES      = *CONVERT
%  CVR1014         TO-FILE              = SDF.DO.LIB.CONTENTS
%  CVR1015         PRODUCE-CONTINUATION = *NEW-MODE
%  CVR1016         REPLACE-OLD-FILE     = *YES
%  CVR1017         SYSTEM-SYNTAX-FILE   = $.SYSSDF.SDF-CONV.030.USER.U-CMD
%  CVR1018         GROUP-SYNTAX-FILE    = $.SYSSDF.SDF-CONV.030.USER.S-CMD
%  CVR1019         UNCHANGED-CMD        = *NONE
%  CVR1020         DOCUMENTATION        = *MINIMUM
%  CVR1021         TARGET-VERSION       = *OSD-V2
%  CVR1022         OUTPUT-FORM          = *STD
%  CVR1023         PROCEDURE-FORMAT     = *SAME(BLOCK-INPUT=*NOT-ALLOWED)

      ***** BS2000 COMMAND  CONVERTER : SDF-CONV V3 *****         page 2
 /PROC N,(&LIBNAME=,&LISTOUT=,&PRINT=,&INPUT),SUBDTA=& ————————————————  (2) 
 /DCLJV #NEWIMAG 
 /SETJV #NEWIMAG,X'0C' 
 /WR-T '&(#NEWIMAG)' 
 /WR-T ' ' 
 /WR-T ' ' 
 /WR-T '*******************************************************' 
 /WR-T '****    Listing of elements stored in a library    ****' 
 /WR-T '*******************************************************' 
 /WR-T ' ' 
 /WR-T 'Name of the library                           : LIBNAME' 
 /REMARK input &LIBNAME 
 /SYSFILE SYSOUT=*DUMMY 
 /FS &LIBNAME 
 /SYSFILE SYSOUT=() 
 /SKIP .LINK 
 /STEP  "Error with FSTATUS" 
 /SYSFILE SYSOUT=() 
 /WR-T ' ' 
 /WR-T ' ' 
 /WR-T 'Input error !' 
 /WR-T 'Library &LIBNAME does not exist/cannot be opened' 
 /SKIP .E 
 /.LINK REMARK Edit the library 
 /WR-T 'Name of the output list                       : LISTOUT' 
 /WR-T 'If the output list already exists                      ' 
 /WR-T 'the data is added at the end of the file.              ' 
 /WR-T 'Is the list to be printed (Y/N) ?             : PRINT  ' 
 /REMARK Input &LISTOUT and &PRINT 
 /SETSW ON=(1) 
 /SYSFILE SYSDTA=(SYSCMD) 
 /SYSFILE SYSLST=(&LISTOUT,EXTEND) 
 /SYSFILE SYSOUT=*DUMMY 
 /FILE &LIBNAME,LINK=LIB001 
 /EXEC $LMS 
 PAR INFO=SUMMARY 
 PRT (LST) 
 LST* (1) 
 END 
 /STEP 
 /SYSFILE SYSOUT=() 
 /SYSFILE SYSLST=() 
 /SYSFILE SYSDTA=() 
 /SETSW OFF=(1) 
 /REL LIB001 
 /WR-T ' ' 
 /WR-T ' ' 
 /WR-T '**** Editing completed.' 
 /WR-T '**** The result is contained in the list &LISTOUT.' 
 /SKIP "Branch dependent on the PRINT variables" .&PRINT 
 /WR-T ' ' 
 /.J REMARK Print the list 
 /PRINT &LISTOUT,PNAME=INF,ENDNO=2048 
%  CVRF040 INPUT COMMAND NOT CONVERTED ————————————————————————————————  (3) 
 /WR-T 'List &LISTOUT being printed.' 
 /.N REMARK 
 /WR-T 'Edit another library or terminate the procedure ?' 
 /SKIP "Input: A (edit) or E (terminate)" .&INPUT 
 /.A REMARK Call the procedure again 
 /DO DO.LIB.CONTENTS 
%  CVRF061 COMMAND CAN NEVER BE CONVERTED TO A SECURED SDF FORM; ORIGINAL 
INPUT REMAINS VALID ———————————————————————————————————————————————————  (4) 
 /STEP 
 /.E REMARK End 
 /WR-T ' ' 
 /WR-T '**** Procedure terminated' 
 /ENDP 

%  CVR1000 CONVERSION TERMINATED WITH: ————————————————————————————————  (5) 
%  CVR1001            FAILURES:    0
%  CVR1002            ERRORS  :    0
%  CVR1003            WARNINGS:    0
%  CVR1004            NOTES   :    2

(1)

The operand values set for the SDF-CONV run are listed.

(2)

All command records in the input procedure are output.

(3)

SDF-CONV issues a NOTE pointing out that the PRINT command could not be converted as its first positional operand is a procedure parameter. For further details see section “Restrictions”.

(4)

SDF-CONV issues a NOTE pointing out that the DO command could not be converted for reasons of context-dependency. For further details see section“Restrictions”.

(5)

The last part of the log is identical with the output to SYSOUT.

Output procedure SDF.DO.LIB.CONTENTS

/BEGIN-PROCEDURE LOGGING=NO,PARAMETERS=YES(PROCEDURE-PARAMETERS=(-
/&LIBNAME=,-
/&LISTOUT=,-
/&PRINT=,-
/&INPUT),ESCAPE-CHARACTER='&')
/SET-JV-LINK  JV-NAME=#NEWIMAG
/MODIFY-JV  JV-CONTENTS=(JV-NAME=#NEWIMAG),SET-VALUE=X'0C'
/WRITE-TEXT '&(#NEWIMAG)' —————————————————————————————————————————————  (1) 
/WRITE-TEXT ' '
/WRITE-TEXT ' '
/WRITE-TEXT '*******************************************************'
/WRITE-TEXT '****    Listing of elements stored in a library    ****'
/WRITE-TEXT '*******************************************************'
/WRITE-TEXT ' '
/WRITE-TEXT 'Name of the library                           : LIBNAME'
/REMARK input &LIBNAME
/ASSIGN-SYSOUT  TO=*DUMMY
/SHOW-FILE-ATTRIBUTES FILE-NAME=&LIBNAME,SELECT=BY-ATTRIBUTES
/ASSIGN-SYSOUT  TO=*PRIMARY
/SKIP-COMMANDS TO-LABEL=LINK
/"*****" REMARK '/STEP  "Error with FSTATUS"' —————————————————————————  (2) 
/SET-JOB-STEP
/ASSIGN-SYSOUT  TO=*PRIMARY
/WRITE-TEXT ' '
/WRITE-TEXT ' '
/WRITE-TEXT 'Input error !'
/WRITE-TEXT 'Library &LIBNAME does not exist/cannot be opened'
/SKIP-COMMANDS TO-LABEL=E
/.LINK REMARK Edit the library
/WRITE-TEXT 'Name of the output list                       : LISTOUT'
/WRITE-TEXT 'If the output list already exists                      '
/WRITE-TEXT 'the data is added at the end of the file.              '
/WRITE-TEXT 'Is the list to be printed (Y/N) ?             : PRINT  '
/REMARK Input &LISTOUT and &PRINT
/MODIFY-JOB-SWITCHES  ON=1
/ASSIGN-SYSDTA  TO=*SYSCMD
/ASSIGN-SYSLST  TO=&LISTOUT,OPEN-MODE=EXTEND
/ASSIGN-SYSOUT  TO=*DUMMY
/CREATE-FILE FILE-NAME=&LIBNAME,SUPPRESS-ERRORS=*FILE-EXISTING
/ADD-FILE-LINK LINK-NAME=LIB001,FILE-NAME=&LIBNAME,SUPPORT=*DISK
/START-PROGRAM FROM-FILE=$LMS
PAR INFO=SUMMARY
PRT (LST)
LST* (1)
END
/SET-JOB-STEP
/ASSIGN-SYSOUT  TO=*PRIMARY
/ASSIGN-SYSLST  TO=*PRIMARY
/ASSIGN-SYSDTA  TO=*PRIMARY
/MODIFY-JOB-SWITCHES  OFF=1
/REMOVE-FILE-LINK LINK-NAME=LIB001
/WRITE-TEXT ' '
/WRITE-TEXT ' '
/WRITE-TEXT '**** Editing completed.'
/WRITE-TEXT '**** The result is contained in the list &LISTOUT.'
/"*****" REMARK '/SKIP "Branch dependent on the PRINT variables" .&PRIN-  (3) 
/T'
/SKIP-COMMANDS TO-LABEL=&PRINT
/WRITE-TEXT ' '
/.J REMARK Print the list
/PRINT &LISTOUT,PNAME=INF,ENDNO=2048 ——————————————————————————————————  (4) 
/WRITE-TEXT 'List &LISTOUT being printed.'
/.N REMARK
/WRITE-TEXT 'Edit another library or terminate the procedure ?'
/"*****" REMARK '/SKIP "Input: A (edit) or E (terminate)" .&INPUT' ————  (5) 
/SKIP-COMMANDS TO-LABEL=&INPUT
/.A REMARK Call the procedure again
/"*****" REMARK '/CALL-PROCEDURE NAME=DO.LIB.CONTENTS' ————————————————  (6) 
/DO DO.LIB.CONTENTS
/SET-JOB-STEP
/.E REMARK End
/WRITE-TEXT ' '
/WRITE-TEXT '**** Procedure terminated'
/EXIT-PROCEDURE

(1)

The WRITE-TEXT command is an SDF command and therefore need not be converted. However, SDF-CONV expands the input command to its full input format.

(2)

The command record with the inline comment is written to a comment line preceding the command line with the conversion result. This ensures that the information in the inline comment is not lost during conversion. (In this case, DOC=*MIN/*MAX must be set.)

(3)

see (2).

(4)

The command record with the unconverted PRINT command is taken over from the input procedure.

(5)

see (2).

(6)

The command record with the unconverted DO command is taken over from the input procedure. At the same time, however, SDF-CONV suggests what the conversion of this DO command could look like. This proposal is written as a comment line preceding the unconverted command record.(In this case, DOC=*MIN/*MAX must be set.)