Mainframe-Daten per Remotezugriff auf Google Cloud transkodieren
Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Das lokale Transcodieren von Daten auf einem Mainframe ist ein CPU-intensiver Vorgang, der zu einem hohen MIPS-Verbrauch (Millionen von Anweisungen pro Sekunde) führt. Um dies zu vermeiden, können Sie Cloud Run verwenden, um Mainframe-Daten ausGoogle Cloud per Remotezugriff in das optimierte Zeilen/Spalten-Format (ORC) zu verschieben und zu transkodieren und sie dann in Cloud Storage zu verschieben. So wird der Mainframe für geschäftskritische Aufgaben freigegeben und der MIPS-Verbrauch wird reduziert.
In der folgenden Abbildung wird beschrieben, wie Sie Ihre Mainframe-Daten zuGoogle Cloud verschieben und sie mit Cloud Run aus der Ferne in das ORC-Format umwandeln und dann in BigQuery verschieben.
Erstellen Sie ein Dienstkonto oder identifizieren Sie ein vorhandenes Dienstkonto, das mit Mainframe Connector verwendet werden soll. Dieses Dienstkonto muss Berechtigungen für den Zugriff auf Cloud Storage-Buckets, BigQuery-Datasets und alle anderen Google Cloud Ressourcen haben, die Sie verwenden möchten.
Prüfen Sie, ob dem von Ihnen erstellten Dienstkonto die Rolle Cloud Run Invoker zugewiesen ist.
Mainframe-Daten zu Google Cloud verschieben und mit Cloud Run per Remote-Zugriff transkodieren Google Cloud
Wenn Sie Ihre Mainframe-Daten zu Google Cloud verschieben und sie per Fernzugriff mit Cloud Run transkodieren möchten, müssen Sie die folgenden Aufgaben ausführen:
Einen Datensatz auf einem Mainframe lesen und transkodieren und im ORC-Format in Cloud Storage hochladen Die Transcodierung erfolgt während des gsutil cp-Vorgangs, bei dem ein EBCDIC-Dataset (Extended Binary Coded Decimal Interchange Code) eines Mainframes beim Kopieren in einen Cloud Storage-Bucket in das ORC-Format in UTF-8 konvertiert wird.
Laden Sie das Dataset in eine BigQuery-Tabelle.
Optional: Führen Sie eine SQL-Abfrage für die BigQuery-Tabelle aus.
Optional: Daten aus BigQuery in eine Binärdatei in Cloud Storage exportieren.
So führen Sie diese Aufgaben aus:
Erstellen Sie auf Ihrem Mainframe einen Job, um den Datensatz auf Ihrem Mainframe zu lesen und in das ORC-Format umzuwandeln. Gehen Sie dazu so vor: Lesen Sie die Daten aus dem INFILE-Dataset und das Datensatzlayout aus dem COPYBOOK-DD.
Der Eingabedatensatz muss eine QSAM-Datei (Queued Sequential Access Method) mit fester oder variabler Datensatzlänge sein.
Eine vollständige Liste der vom Mainframe-Connector unterstützten Umgebungsvariablen finden Sie unter Umgebungsvariablen.
Wenn Sie die während dieses Vorgangs ausgeführten Befehle protokollieren möchten, können Sie Ladestatistiken aktivieren.
Optional: Erstellen und senden Sie einen BigQuery-Abfragejob, der eine SQL-Leseoperation aus der QUERY-DD-Datei ausführt.
Normalerweise handelt es sich bei der Abfrage um eine MERGE- oder SELECT INTO DML-Anweisung, die zur Transformation einer BigQuery-Tabelle führt. Hinweis: Der Mainframe-Connector protokolliert Jobmesswerte, schreibt Abfrageergebnisse aber nicht in eine Datei.
Sie können BigQuery auf verschiedene Arten abfragen: inline, mit einem separaten Dataset mit DD oder mit einem separaten Dataset mit DSN.
Außerdem müssen Sie die Umgebungsvariable BQ_QUERY_REMOTE_EXECUTION=true festlegen.
Ersetzen Sie Folgendes:
PROJECT_NAME: Der Name des Projekts, in dem Sie die Abfrage ausführen möchten.
LOCATION: Der Ort, an dem die Abfrage ausgeführt wird. Wir empfehlen, die Abfrage an einem Ort auszuführen, der sich in der Nähe der Daten befindet.
Optional: Erstellen und senden Sie einen Exportjob, der eine SQL-Leseoperation aus der QUERY-DD-Datei ausführt und den resultierenden Datensatz als Binärdatei in Cloud Storage exportiert.
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-08-19 (UTC)."],[],[],null,["# Transcode mainframe data remotely on Google Cloud\n\nTranscoding data locally on a mainframe is a CPU-intensive process that results\nin high million instructions per second (MIPS) consumption. To avoid this, you\ncan use Cloud Run to move and transcode mainframe data remotely on\nGoogle Cloud to optimized row columnar (ORC) format and then move the data to\nCloud Storage. This frees up your mainframe for business critical tasks and\nalso reduces MIPS consumption.\n\nThe following figure describes how you can move your mainframe data to\nGoogle Cloud and transcode it remotely to ORC format using\nCloud Run, and then move the content to BigQuery.\n\n\u003cbr /\u003e\n\nRemotely transcode mainframe data\n\n\u003cbr /\u003e\n\nBefore you begin\n----------------\n\n- [Deploy Mainframe Connector on Cloud Run](/mainframe-connector/docs/deploy-mainframe-connector).\n- [Create a service account](/iam/docs/service-accounts-create) or identify an existing service account to use with Mainframe Connector. This service account must have permissions to access Cloud Storage buckets, BigQuery datasets, and any other Google Cloud resource that you want to use.\n- Verify that the service account you created is assigned the [Cloud Run Invoker role](/run/docs/reference/iam/roles#run.invoker).\n\nMove mainframe data to Google Cloud and transcode it remotely using Cloud Run\n-----------------------------------------------------------------------------\n\nTo move your mainframe data to Google Cloud and transcode it remotely using\nCloud Run, you must perform the following tasks:\n\n1. Read and transcode a dataset on a mainframe, and upload it to Cloud Storage in ORC format. Transcoding is done during the [`gsutil cp`](/mainframe-connector/docs/api-command-reference#gsutil_cp) operation, where a mainframe extended binary coded decimal interchange code (EBCDIC) dataset is converted to the ORC format in UTF-8 during the copy to a Cloud Storage bucket.\n2. Load the dataset to a BigQuery table.\n3. (Optional) Execute a SQL query on the BigQuery table.\n4. (Optional) Export data from BigQuery into a binary file in Cloud Storage.\n\nTo perform these tasks, follow these steps:\n\n1. On your mainframe, create a job to read the dataset on your mainframe and\n transcode it to ORC format, as follows. Read the data from the\n [INFILE dataset](/mainframe-connector/docs/reference#dataset-names), and the\n record layout from the [COPYBOOK DD](/mainframe-connector/docs/reference#dataset-names).\n The input dataset must be a queued sequential access method (QSAM) file with\n fixed or variable record length.\n\n | **Note**\n | - Not all Google Cloud commands support remote transcoding. For more information, see [Mainframe Connector API reference](/mainframe-connector/docs/reference).\n | - Variables with the suffix `FILLER` are ignored during the import process.\n | - From version 5.12.0 onwards, Mainframe Connector replaces hyphens (\"-\") with underscores (\"_\") in variable names. If you want to keep hyphens in your variable names, disable this automatic conversion by setting the database variable `BQSH_FEATURE_CONVERT_UNDERSCORE_IN_FIELDS_NAME` to `false`.\n\n For the complete list of environment variables supported by\n Mainframe Connector, see [Environment variables](/mainframe-connector/docs/environment-variables). \n\n //STEP01 EXEC BQSH\n //INFILE DD DSN=\u003cHLQ\u003e.DATA.FILENAME,DISP=SHR\n //COPYBOOK DD DISP=SHR,DSN=\u003cHLQ\u003e.COPYBOOK.FILENAME\n //STDIN DD *\n gsutil cp --replace gs://mybucket/tablename.orc --remote \\\n --remoteHost \u003cmainframe-connector-url\u003e.a.run.app \\\n --remotePort 443\n /*\n\n If you want to log the commands executed during this process, you can [enable load statistics](/mainframe-connector/docs/reference#enable_load_statistics).\n2. (Optional) Create and submit a BigQuery query job that executes a SQL read from\n the [QUERY DD file](/mainframe-connector/docs/reference#dataset-names).\n Typically the query will be a `MERGE` or `SELECT INTO DML`\n statement that results in transformation of a BigQuery table. Note\n that Mainframe Connector logs in job metrics but doesn't write query\n results to a file.\n\n You can query BigQuery in various ways-inline, with a separate\n dataset using DD, or with a separate dataset using DSN. \n\n Example JCL\n //STEP03 EXEC BQSH\n //QUERY DD DSN=\u003cHLQ\u003e.QUERY.FILENAME,DISP=SHR\n //STDIN DD *\n PROJECT=\u003cvar translate=\"no\"\u003ePROJECT_NAME\u003c/var\u003e\n LOCATION=\u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e\n bq query --project_id=$PROJECT \\\n --location=$LOCATION \\\n --remoteHost \u003cmainframe-connector-url\u003e.a.run.app \\\n --remotePort 443/*\n /*\n\n Additionally, you must set the environment variable `BQ_QUERY_REMOTE_EXECUTION=true`.\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003ePROJECT_NAME\u003c/var\u003e: The name of the project in which you want to execute the query.\n - \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: The location for where the query will be executed. We recommended that you execute the query in a location close to the data.\n3. (Optional) Create and submit an export job that executes a SQL read from the\n [QUERY DD file](/mainframe-connector/docs/reference#dataset-names), and exports\n the resulting dataset to Cloud Storage as a binary file.\n\n Example JCL\n //STEP04 EXEC BQSH\n //OUTFILE DD DSN=\u003cHLQ\u003e.DATA.FILENAME,DISP=SHR\n //COPYBOOK DD DISP=SHR,DSN=\u003cHLQ\u003e.COPYBOOK.FILENAME\n //QUERY DD DSN=\u003cHLQ\u003e.QUERY.FILENAME,DISP=SHR\n //STDIN DD *\n PROJECT=\u003cvar translate=\"no\"\u003ePROJECT_NAME\u003c/var\u003e\n DATASET_ID=\u003cvar translate=\"no\"\u003eDATASET_ID\u003c/var\u003e\n DESTINATION_TABLE=\u003cvar translate=\"no\"\u003eDESTINATION_TABLE\u003c/var\u003e\n BUCKET=\u003cvar translate=\"no\"\u003eBUCKET\u003c/var\u003e\n bq export --project_id=$PROJECT \\\n --dataset_id=$DATASET_ID \\\n --destination_table=$DESTINATION_TABLE \\\n --location=\"US\" \\\n --bucket=$BUCKET \\\n --remoteHost \u003cmainframe-connector-url\u003e.a.run.app \\\n --remotePort 443\n /*\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003ePROJECT_NAME\u003c/var\u003e: The name of the project in which you want to execute the query.\n - \u003cvar translate=\"no\"\u003eDATASET_ID\u003c/var\u003e: The BigQuery dataset ID that contains the table that you want to export.\n - \u003cvar translate=\"no\"\u003eDESTINATION_TABLE\u003c/var\u003e: The BigQuery table that you want to export.\n - \u003cvar translate=\"no\"\u003eBUCKET\u003c/var\u003e: The Cloud Storage bucket that will contain the output binary file.\n\nWhat's next\n-----------\n\n- [Move locally transcoded mainframe data to Google Cloud](/mainframe-connector/docs/local-transcoding)\n- [Transcode mainframe data remotely on Google Cloud](/mainframe-connector/docs/remote-transcoding)\n- [Transcode mainframe data moved to Google Cloud using a virtual tape library](/mainframe-connector/docs/vtl-transcoding)"]]