IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

REquirement here:code required


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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
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
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
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts run rexx code with jcl CLIST & REXX 15
No new posts Compile rexx code with jcl CLIST & REXX 6
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
No new posts VSAM return code 23 - for a Random read COBOL Programming 4
No new posts Monitoring production job progress. N... JCL & VSAM 4
Search our Forums:

Back to Top