Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
REquirement here:code required

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
sripallu

New User


Joined: 11 May 2005
Posts: 12
Location: India

PostPosted: Sun Apr 02, 2006 1:01 pm    Post subject: REquirement here:code required
Reply with quote

Hello gurus,
We are having an uregetn requirement for generating a loop

the requirement is
we are generating reports from RPT59A to RPT59Z
after Z the program gets into infinite loop....
so we need to start from RPT59AA to RPT59ZZ

Current scenario

declarations
01 LETTER-INCREMENT-AREA.
03 INCREMENT-AREA PIC 9(4) COMP.
03 INCREMENT-AREA-R REDEFINES INCREMENT-AREA.
05 FILLER PIC X.
05 LETTER-INC PIC X.
implementation
MOVE 0 TO INCREMENT-AREA
MOVE GAT-PROCESS-NAME(GAT-RESULT:1) TO LETTER-INC
ADD 1 TO INCREMENT-AREA
MOVE LETTER-INC TO GAT-PROCESS-NAME(GAT-RESULT:1)

we need the same as to generate RPT59AA to RPT59ZZ


Thanks in Advance
SriPallu
Currently it loops when the A thru Z are used. The new fix should still begin with A and then go through Z, then begin with double alpha AA thru ZZ.
Back to top
View user's profile Send private message

DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Mon Apr 03, 2006 6:15 pm    Post subject: Re: REquirement here:code required
Reply with quote

sripallu,

I don't understand what the code is that you have supplied. Please give the complete code that is failing with an explanation of any inbound variables used to control the loop.

As I understand you requirements, you need to produce reports named 'RPT59A' - 'RPT59Z' then 'RPT59AA' - 'RPT59AA'. Is the problem within the loop in constucting the report name? How to go from 'PRT59A' to RPT59B', then C etc.?

Please come back,

Dave
Back to top
View user's profile Send private message
martin9

Active User


Joined: 01 Mar 2006
Posts: 290
Location: Basel, Switzerland

PostPosted: Mon Apr 03, 2006 9:41 pm    Post subject:
Reply with quote

hy sripallu,

as i see it,
you need a decimal to hexadecimal conversion,
to get the two last letters. just if the hexadecimal values
are from 0A to 0Z, you only want the last letter...

the code you provided, is not clear, how you want to do this.

but this should be really no problem,
maybe you can deliver more details...
i.e. waht is GAT-PROCESS-NAME?? and
what is it's value, it probably changes...

martin9
Back to top
View user's profile Send private message
sripallu

New User


Joined: 11 May 2005
Posts: 12
Location: India

PostPosted: Tue Apr 04, 2006 2:02 pm    Post subject:
Reply with quote

hello david and martin
thanks for ur replies

@david here is the code that converts thr report from RPT59A to RPT59B

MOVE 0 TO INCREMENT-AREA
MOVE GAT-PROCESS-NAME(GAT-RESULT:1) TO LETTER-INC
ADD 1 TO INCREMENT-AREA
MOVE LETTER-INC TO GAT-PROCESS-NAME(GAT-RESULT:1)

@martin

GAT-PROCESS-NAME contains the location the reports are generated like
work01.hemout.rpt59A
the GAT-RESULT in above code takesa value of 21 and get the last character of GAT-PROCESS-NAME ..

hope i am clear
Back to top
View user's profile Send private message
DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Tue Apr 04, 2006 11:39 pm    Post subject: Re: REquirement here:code required
Reply with quote

Quote:

MOVE 0 TO INCREMENT-AREA
MOVE GAT-PROCESS-NAME(GAT-RESULT:1) TO LETTER-INC
ADD 1 TO INCREMENT-AREA
MOVE LETTER-INC TO GAT-PROCESS-NAME(GAT-RESULT:1)



Please give us the definitions/relationship between LETTER-INC and INCREMENT-AREA

Adding 1 to a display letter value does not necessarily result in the next letter.

Check this link to the EBCDIC Collating Sequence

Also, when you say you want to generate reports RPT59A ? RPT59Z then RPT59AA ? RPT59ZZ do you want reports ID?s RPT59AA, RPT59BB?. Or RPT59AA, RPT59AB?RPT59BA, RPT59BB?.

Dave
Back to top
View user's profile Send private message
sripallu

New User


Joined: 11 May 2005
Posts: 12
Location: India

PostPosted: Wed Apr 05, 2006 1:16 pm    Post subject:
Reply with quote

the first one david the sequence would be like below
RPT59A,RPT59B,RPT59C,........RPT59Z,RPT59AA,RPT59AB,RPT59AC,.......RPT59BA,RPT59BB,RPT59BC........RPT59ZZ..

i got the logic but its generating like RPT59AA,RPT59BA,..
my move statement is not working as i expected

MOVE GAT-PROCESS-NAME(GAT-RESULT+1:1) TO WS-BETA-LETTER
the stmt above is not working icon_sad.gif
is thr any alternate way of incrmenting the GAT-RESULT with out using another varible
( i mean by any arthemetic operators)


the LETTER-INC and INCREMENT-AREA are declared like this

01 LETTER-INCREMENT-AREA.
03 INCREMENT-AREA PIC 9(4) COMP.
03 INCREMENT-AREA-R REDEFINES INCREMENT-AREA.
05 FILLER PIC X.
05 LETTER-INC PIC X.

as we increase the INCREMENT-AREA the letetr will autmatically increase due to REDFEFINES clause
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. how to code for GDG in Rexx cvnlynn CLIST & REXX 13 Wed Aug 09, 2017 9:13 pm
This topic is locked: you cannot edit posts or make replies. rexx code to create a ps file Bharath Vikraman CLIST & REXX 4 Mon Aug 07, 2017 10:30 am
No new posts I want to retire TRX and use only Rex... Abhinav Sharma CLIST & REXX 6 Sat Jul 29, 2017 2:53 am
No new posts UNIT=AFF for Easytrieve code gandikk JCL & VSAM 7 Wed Jul 12, 2017 11:42 pm
No new posts DB2 Program abending without giving a... rahulgarg14 DB2 7 Mon May 29, 2017 8:10 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us