View previous topic :: View next topic |
Author |
Message |
gore Beginner
Joined: 10 Dec 2002 Posts: 46 Topics: 20 Location: Providence, RI
|
Posted: Thu Mar 18, 2004 12:15 am Post subject: TRANSFORM in COBOL |
|
|
I have a COBOL program that seems to belong to some old version of COBOL. It uses a verb called TRANSFORM. i am sending the program for your reference, can someone tell me what transfrom is exactly doing and which version of cobol compiler should i use for this program?
Code: | 001180 WORKING-STORAGE SECTION.
001190 77 MNM PIC X(8) VALUE 'LSS011 '.
001200 01 TEMP-WORK-AREA.
001210 02 WK-CON-LENGTH.
001220 03 CON-M PIC X.
001230 03 CON-YY PIC XX.
001240 02 WK-BASE.
001250 03 BASE-MM.
001260 04 BM1 PIC X.
001270 04 BM2 PIC X.
001280 03 BASE-YY PIC XX.
001290 03 BASE-DD PIC 99.
001300 01 TSUB PIC S99 COMP-3 VALUE ZEROS.
001310 01 TRANB PIC X(27) VALUE '019681854337989753724526010'.
001320 01 TRANA PIC X(27) VALUE ' ABCDEFGHIJKLMNOPQRSTUVWXYZ'.
001330 01 TRANC PIC X(27) VALUE 'ABCDEFGHIJKLMNOPQRSTUVWXYZ '.
001340 01 TRANC-I REDEFINES TRANC.
001350 02 TRAN-I OCCURS 27 PIC X.
001360 01 CKDGLENC PIC 9999 VALUE 10 COMP.
001370 LINKAGE SECTION.
-INC LSC015 00001380
001390 PROCEDURE DIVISION USING LSC015-ARGS.
001400 IF LSC015-4-POS-BIRTH-DATE OR
001410 LSC015-3-POS-BIRTH-DATE
001420 MOVE '0' TO LSC015-RET-CODE
001430 ELSE
001440 MOVE '1' TO LSC015-RET-CODE
001450 GO TO 0500-GOBACK.
001460 MOVE ZEROS TO TSUB.
001470 0100-AD-1.
001480 ADD 1 TO TSUB.
001490 IF TSUB > 4 GO TO 0200-CONT-DATE.
001500 IF LSC015-FIRSTNM (TSUB) = 'A' OR 'I' OR 'J' OR 'R' OR 'S' OR
001510 'Z' OR ' ' GO TO 0100-AD-1.
001520 IF LSC015-FIRSTNM (TSUB) > 'A' AND < 'I' GO TO 0100-AD-1.
001530 IF LSC015-FIRSTNM (TSUB) > 'J' AND < 'R' GO TO 0100-AD-1.
001540 IF LSC015-FIRSTNM (TSUB) > 'S' AND < 'Z' GO TO 0100-AD-1.
001550 MOVE ' ' TO LSC015-FIRSTNM (TSUB) GO TO 0100-AD-1.
001560 0200-CONT-DATE.
001570 IF LSC015-3-POS-BIRTH-DATE
001580 PERFORM 0600-BIRTH-DATE-CONV THRU
001590 0600-BIRTH-DATE-CONV-EXIT
001600 ELSE
001610 MOVE LSC015-BIRTHDT-MM-4 TO BASE-MM
001620 MOVE LSC015-BIRTHDT-YY-4 TO BASE-YY.
001630 MOVE ZEROS TO TSUB.
001640 0300-AD-TSUB.
001650 ADD 1 TO TSUB.
001660 IF TSUB > 27 MOVE 01 TO TSUB
001670 GO TO 0400-MOVE-DD.
001680 IF LSC015-MIDDLE-INT = TRAN-I (TSUB) GO TO 0400-MOVE-DD.
001690 GO TO 0300-AD-TSUB.
001700 0400-MOVE-DD.
001710 MOVE TSUB TO BASE-DD.
001720 IF LSC015-go-away-spammer-sucker = 'F' ADD 27 TO BASE-DD.
001730 MOVE WK-BASE TO LSC015-CHAR-1-6.
001740 MOVE LSC015-FIRSTNAME TO LSC015-FST-CONV.
001750 TRANSFORM LSC015-IDNUM CHARACTERS FROM TRANA TO TRANB.
001760 0500-GOBACK.
001770 GOBACK.
001780 EJECT
001790* <----------*PERFORMED PARAGRAPHS START HERE*----------->
001800 0600-BIRTH-DATE-CONV.
001810 MOVE LSC015-BIRTHDT-3-POS TO WK-CON-LENGTH.
001820 MOVE CON-YY TO BASE-YY.
001830 MOVE CON-M TO BM2.
001840 MOVE '0' TO BM1.
001850 IF BM2 = '0'
001860 MOVE '10' TO BASE-MM.
001870 IF BM2 = '-'
001880 MOVE '11' TO BASE-MM.
001890 IF BM2 = '&'
001900 MOVE '12' TO BASE-MM.
001910 0600-BIRTH-DATE-CONV-EXIT.
001920 EXIT. |
_________________ Gore |
|
Back to top |
|
|
gore Beginner
Joined: 10 Dec 2002 Posts: 46 Topics: 20 Location: Providence, RI
|
Posted: Thu Mar 18, 2004 8:15 am Post subject: |
|
|
Thanks Ravi. That was very informative . _________________ Gore |
|
Back to top |
|
|
Jaya Beginner
Joined: 02 Sep 2005 Posts: 77 Topics: 10 Location: Cincinnati
|
Posted: Tue Jun 13, 2006 12:18 am Post subject: |
|
|
Hi,
My current task is to convert a OS/VS cobol CICS IDMS code to its
VS COBOL 2 version. In this process, i had to replace the TRANSFORM verb used in the code with the INSPECT verb.
I replaced the sentence
Quote: | TRANSFORM FIELDA CHARACTERS FROM '_' TO ' '
| to
Quote: | INSPECT FIELDA REPLACING ALL '_' BY ' '
|
Please confirm whether the above conversion is right. If possible please give me the syntax of the transform verb.
With the above changes made, My code is getting compiled successfully with IDMS-CICS-VScobol 2 compiler. Is that mean my OS/VS cobol conversion task is completed?
Please let me know if i have to check something else..
Thanks,
Jaya. _________________ "Great spirits have always encountered violent opposition from mediocre minds."
-Albert Einstein |
|
Back to top |
|
|
Jaya Beginner
Joined: 02 Sep 2005 Posts: 77 Topics: 10 Location: Cincinnati
|
Posted: Thu Jun 22, 2006 5:09 am Post subject: |
|
|
F.Y.I..
Steps for upgrading the OS/VS cobol CICS code to its VS COBOL 2 version..
1. To prepare the list of OS/VS cobol programs that needs to be upgraded.
I looked at the MAP CSECTS of every program load module in the CICS load library using file-aid to determine whether the program is VS cobol or COBOL 2 version.
2. I manually recompiled all the OS/VS cobol-IDMS-CICS code with it's VSCOBOL 2 compiler and cleared all the compilation errors and tested them.
I referred the VS COBOL II V1R4.0 Migration Guide for MVS and CMS documentation in the IBM server.
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IGYM1101/CCONTENTS?SHELF=IGYSH007&DN=GC26-3151-00&DT=19930312152044
Chapter 4 and Chapter 7 in the above documentation will give all the language elements that need to be changed with examples including the TRANSFORM verb .Luckily i have to change only few programs..
There are some conversion tools like CA-Migrate are available in the market which can be leveraged for ugradation..
Thanks,
Jaya _________________ "Great spirits have always encountered violent opposition from mediocre minds."
-Albert Einstein |
|
Back to top |
|
|
|
|