This is of course do-able in COBOL with the unstring verb but it
can be a bit tedious.
You could consider invoking a command file to do the parsing
by using call intrinsic "HPCICOMMAND"
(I dont think you have any migrations issues with this task ;-))
and then just retrieving the variables created by using
call intrinsic "HPCIGETVAR"
Here is what the command file could look like,
anyparm a_jobcard=:job jobname,mpeuser.acctname,group;otherparms
setvar jobcard anyparm(!a_jobcard)
setvar jobcard xword(jobcard)
setvar jfield1 rtrim(word (jobcard,";"))
setvar jfield2 rtrim(xword(jobcard,";"))
setvar jobid1 word(jfield1,,1)
setvar jobid2 word(jfield1,,2)
setvar jobid3 word(jfield1,,3)
if pos(".",jobid1) > 0
setvar jobid3 jobid2
setvar jobid2 jobid1
setvar jobid1 ""
endif
setvar myjobname jobid1
setvar mympeuser word(jobid2,".",1)
setvar myacctname word(jobid2,".",2)
setvar mylogongrp word(jobid3)
setvar myotherfld jfield2
deletevar jfield#,jobid#
return
Internet
[log in to unmask]@RAVEN.UTC.EDU - 30/07/2002 16:54
Veuillez répondre à [log in to unmask]
Envoyé par : [log in to unmask]
Pour : HP3000-L
cc :
Objet : Decomposing a !JOB card to single tokens - in COBOL
Greetings,
I'm writing a COBOL program that needs to break a !JOB card into it's
constituent parts.
For example;
field 1 = stream char and JOB
field 2 = job name (spaces if not supplied)
field 3 = user name
field 4 = user password (spaces if not supplied)
field 5 = account name
field 6 = account password (spaces if not supplied)
field 7 = group name (spaces if not supplied)
field 8 = group password (spaces if not supplied)
field 9 and onwards = any other jobcard parameters that are found
To prevent me from having to 'reinvent the wheel' is there anybody who has
done this and is willing to pass on a snippet (or more) of code?
regards,
Robert W.Mills
Systems Development Manager
Windsong Services
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
This message and any attachments (the "message") is
intended solely for the addressees and is confidential.
If you receive this message in error, please delete it and
immediately notify the sender. Any use not in accord with
its purpose, any dissemination or disclosure, either whole
or partial, is prohibited except formal approval. The internet
can not guarantee the integrity of this message.
BNP PARIBAS (and its subsidiaries) shall (will) not
therefore be liable for the message if modified.
---------------------------------------------
Ce message et toutes les pieces jointes (ci-apres le
"message") sont etablis a l'intention exclusive de ses
destinataires et sont confidentiels. Si vous recevez ce
message par erreur, merci de le detruire et d'en avertir
immediatement l'expediteur. Toute utilisation de ce
message non conforme a sa destination, toute diffusion
ou toute publication, totale ou partielle, est interdite, sauf
autorisation expresse. L'internet ne permettant pas
d'assurer l'integrite de ce message, BNP PARIBAS (et ses
filiales) decline(nt) toute responsabilite au titre de ce
message, dans l'hypothese ou il aurait ete modifie.
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
|