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

Handling swift Message


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
naveen.m

New User


Joined: 02 Nov 2007
Posts: 9
Location: BENGALURU

PostPosted: Mon Oct 04, 2010 12:37 pm
Reply with quote

Hi,

Please can any one help me with my issue below.

I'm receiving an string from an front end screen from free text editor of 32 lines and 50 Character/line(Using Swift 799 message format). I need to store the data(LINE BY LINE) in the DB2 table as entered on the front end screen, But my program is receiving the entire 50 char of the line.

My requirement is "I need to get the string till the end of the each line and store it a single row , this has to be repeated till the end of the string(i.e as many number of lines are entered in the screen) '

Please find the below code ,

DIVIDE SWFT79-LEN in mi by 50 Giving LEN in ws
REMAINDER rem-ws

if Len in ws less than or equal to 35

initialize IX
K
Z

move 1 TO Z
move 50 TO K

if rem-ws > 0
compute len in ws = len in ws + 1
end-if

perform
varying Ix in ws
from 1 by 1
until Ix in ws >
Len in ws

move SWFT79-TXT in mi(z:k) to
SWFT79 in AWA7991C(Ix in ws)
compute Z in ws = Z in ws + 50

end-perform
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon Oct 04, 2010 1:17 pm
Reply with quote

1. what is the data definition of the SWFT79-txt?

2. are the rows variable length?

3. DIVIDE SWFT79-LEN in mi by 50 Giving LEN in ws
REMAINDER rem-ws
LEN is actually an occurance, why give it a reference name as LEN?

4. Why do you reference 35 in
if Len in ws less than or equal to 35
when you stated that you can only have 32 lines?

5. is the char stream in SWFT79-TXT just a pure image from the front end screen,
which apparently is 32 lines of 50 char each?
are there control characters between each line?
or do we have 1600 bytes (32 lines X 50 char) of only char?

6. in:
initialize IX
K
Z

move 1 TO Z
move 50 TO K

why initialize k and z when you immediately populate them?

7. what do you do when if Len in ws > 35?
you end up performing without any initialized work fields

8. why not redefine SWFT79-TXT to have an occurs of 32?
then you could us indexing instead of reference modification
which would require fewer resources.


9. are you going to follow your behavior as in this thread that you started:
ibmmainframes.com/viewtopic.php?t=29411&highlight=
and never respond?

10. last but not least what is your issue?
Back to top
View user's profile Send private message
naveen.m

New User


Joined: 02 Nov 2007
Posts: 9
Location: BENGALURU

PostPosted: Mon Oct 04, 2010 3:10 pm
Reply with quote

Thanks for your quick reply.

1. what is the data definition of the SWFT79-txt?
PIC X(100) .

2. are the rows variable length?

Yes , it is a VARCHAR SIZE 100

3. DIVIDE SWFT79-LEN in mi by 50 Giving LEN in ws
REMAINDER rem-ws
LEN is actually an occurance, why give it a reference name as LEN?

Quote:
This is the one i need to take care of now, As previously we where calculatin the no of lines in the message and storing the 50 char in a single Row, But now i have to take the first line of the message .

Let me expalin by example.

This is the format user is entring from the screen.

1...............................................................50 (no of char)
1 Eaple keypad
2 adsas asdasdas adasdasd
3 asdasdadf aasdfsdas das ddasasdas
.
.
35
-----------------------------------------------------------------
In my system i'm reciving this as an array and updating it into the table, While displaying i'm getting the output as

1...............................................................50 (no of char)
1 Eaple keypad..adsas asdasdas adasdasd..as
2 dasdadf aasdfsdas das ddasasdas..
3
.
35
---------------------------------------------------------------------

I need to store each line in one row so that i can display the same in my next output on screen as below.

Quote:
1...............................................................50 (no of char)
1 Eaple keypad
2 adsas asdasdas adasdasd
3 asdasdadf aasdfsdas das ddasasdas
.
.
35
-----------------------------------------------------------------



4. Why do you reference 35 in
if Len in ws less than or equal to 35
when you stated that you can only have 32 lines?

We are referncing this bcos before we where counting the no of line's(i.e for Max 35 lines)

5. is the char stream in SWFT79-TXT just a pure image from the front end screen,
which apparently is 32 lines of 50 char each?
are there control characters between each line?
or do we have 1600 bytes (32 lines X 50 char) of only char?


Yes its a purged image,Its has a controlled character at the end of the each line X'od25' .

6. in:
initialize IX
K
Z

move 1 TO Z
move 50 TO K

why initialize k and z when you immediately populate them?

This coding is done before.

7. what do you do when if Len in ws > 35?
you end up performing without any initialized work fields

Yes, we end up performing.

8. why not redefine SWFT79-TXT to have an occurs of 32?
then you could us indexing instead of reference modification
which would require fewer resources.

Without changing the copybook i need to handle this

9. are you going to follow your behavior as in this thread that you started:
ibmmainframes.com/viewtopic.php?t=29411&highlight=
and never respond?

"I apologize for this , As the issue was resolved i was unable to answer reply back to my query"

10. last but not least what is your issue?
Please find the same in the 3rd question

Hope i've answerd your question, let me know for anything.[quote]
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon Oct 04, 2010 3:39 pm
Reply with quote

i personally would UNSTRING delimited by X'od25'
into AWA7991C(1)
AWA7991C(2)
AWA7991C(3) ...
AWA7991C(35)

after first initializing the table to spaces.

then if the length of the data of each line needs to be calculated,
i would inspect(reverse( AWA7991C(n))) counting spaces.....
after first checking if AWA7991C(n) is indeed > spaces

and base on the above I would also know how many rows to insert.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon Oct 04, 2010 4:49 pm
Reply with quote

Quote:
1. what is the data definition of the SWFT79-txt?
PIC X(100) .

the above can not be true.

Quote:
This coding is done before.

so you leave it in even though it is very poor code?

Quote:
Its has a controlled character at the end of the each line X'od25' .

so is each line 50 or 52?

which means that
Quote:
compute Z in ws = Z in ws + 50

this is some more of the same rookie/garbage/stupid code......

rewrite this garbage
Back to top
View user's profile Send private message
naveen.m

New User


Joined: 02 Nov 2007
Posts: 9
Location: BENGALURU

PostPosted: Mon Oct 04, 2010 7:42 pm
Reply with quote

My mistake, sorry for providing the wrong information

1. what is the data definition of the SWFT79-txt?
dbzTHEdinosauer wrote:
Quote:
PIC X(100) .

the above can not be true.

SWFT79-TXT PIC X(1750)


Quote:
Its has a controlled character at the end of the each line X'od25' .

so is each line 50 or 52?

Each line is of 50 char.


which means that
Quote:
compute Z in ws = Z in ws + 50

this is some more of the same rookie/garbage/stupid code......

rewrite this garbage


Yes, I've written the code as you mentioned.

Thanks a lot for your help,Guess my code is working fine and is formatted properly. Need to test it....
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Mon Oct 04, 2010 7:54 pm
Reply with quote

Googling "Swift Messaging" will yield many hits.

Bill
Back to top
View user's profile Send private message
naveen.m

New User


Joined: 02 Nov 2007
Posts: 9
Location: BENGALURU

PostPosted: Wed Oct 06, 2010 7:50 pm
Reply with quote

Bill O'Boyle wrote:
Googling "Swift Messaging" will yield many hits.

Bill

Hi Bill, Thanks for your reply. My query is to handle swift message in my cobol program.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Wed Oct 06, 2010 8:04 pm
Reply with quote

This shouldn't be a big problem.

They're certainly not as challenging as Authorization ISO 8583 Bit-Mapped messages being handled in COBOL (much easier with Assembler).

Bill
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 omegamon for cics -UNSUPPORTED ENVIRO... CICS 2
This topic is locked: you cannot edit posts or make replies. how can I proof that message was post... Java & MQSeries 1
No new posts IMS Message : DFS3577A IMS DB/DC 4
No new posts dsnrexx fails without error message CLIST & REXX 9
No new posts File Handling COBOL Programming 9
Search our Forums:

Back to Top